Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
35 | protected function curl_get_contents($url) |
||
36 | { |
||
37 | $curl = curl_init($url); |
||
38 | curl_setopt($curl, CURLOPT_FAILONERROR, 1); |
||
39 | curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); |
||
40 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); |
||
41 | curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); |
||
42 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); |
||
43 | curl_setopt($curl, CURLOPT_TIMEOUT, 30); |
||
44 | $response = curl_exec($curl); |
||
45 | curl_close($curl); |
||
46 | |||
47 | return $response; |
||
48 | } |
||
50 |
If you suppress an error, we recommend checking for the error condition explicitly: