Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
46 | 9 | private function doGet($url) |
|
47 | { |
||
48 | 9 | $ch = curl_init(); |
|
49 | 9 | curl_setopt($ch, CURLOPT_URL, $url); |
|
50 | 9 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
51 | 9 | curl_setopt($ch, CURLOPT_HEADER, 0); |
|
52 | 9 | curl_setopt($ch, CURLOPT_TIMEOUT_MS, $this->outTime * 1000); |
|
53 | 9 | curl_setopt($ch, CURLOPT_HTTPHEADER, [ |
|
54 | 9 | "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)", |
|
55 | 9 | ]); |
|
56 | 9 | $output = curl_exec($ch); |
|
57 | 9 | curl_close($ch); |
|
58 | |||
59 | 9 | return $output; |
|
60 | } |
||
61 | } |