| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | public function get($url) |
||
| 8 | { |
||
| 9 | if (function_exists("curl_init")) { |
||
| 10 | $ch = curl_init(); |
||
| 11 | curl_setopt($ch, CURLOPT_URL, $url); |
||
| 12 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
||
| 13 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); |
||
| 14 | $content = curl_exec($ch); |
||
| 15 | curl_close($ch); |
||
| 16 | return $content; |
||
| 17 | } else { |
||
| 18 | return file_get_contents($url); |
||
| 19 | } |
||
| 20 | } |
||
| 21 | } |
||
| 22 |