Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | protected function remoteCall($url) |
||
44 | { |
||
45 | $ch = curl_init(); |
||
46 | $timeout = 5; |
||
47 | curl_setopt($ch, CURLOPT_URL, $url); |
||
48 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
||
49 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); |
||
50 | $data = curl_exec($ch); |
||
51 | |||
52 | $result = false; |
||
53 | if (!curl_errno($ch)) { |
||
54 | curl_close($ch); |
||
55 | $result = json_decode(str_replace(")]}'\n", '', $data), true); |
||
56 | } |
||
57 | |||
58 | return $result; |
||
59 | } |
||
60 | } |
||
61 |