Skip to content

Commit adc0e0c

Browse files
committed
Improvements
* CurlDriver: support check * StreamDriver: detection of possible errors with fopen+http
1 parent 1731b00 commit adc0e0c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Drivers/CurlDriver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(Proxy $proxy)
3636
*/
3737
public function support()
3838
{
39-
return true;
39+
return function_exists('curl_init');
4040
}
4141

4242
/**

src/Drivers/StreamDriver.php

+4
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ public function exec($url, &$httpStatus, &$contentType, &$errorCode, &$errorMess
122122
if ($timedOut) {
123123
$this->proxy->resetTemporary();
124124
}
125+
} else {
126+
$err = error_get_last();
127+
$errorCode = $err['type'];
128+
$errorMessage = $err['message'];
125129
}
126130
}
127131
}

0 commit comments

Comments
 (0)