|
|
@@ -293,7 +293,9 @@ class Stream
|
|
|
*/
|
|
|
protected function _open($url)
|
|
|
{
|
|
|
- set_error_handler([$this, '_connectionErrorHandler']);
|
|
|
+ set_error_handler(function ($code, $message) {
|
|
|
+ $this->_connectionErrors[] = $message;
|
|
|
+ });
|
|
|
$this->_stream = fopen($url, 'rb', false, $this->_context);
|
|
|
restore_error_handler();
|
|
|
|
|
|
@@ -303,19 +305,6 @@ class Stream
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Local error handler to capture errors triggered during
|
|
|
- * stream connection.
|
|
|
- *
|
|
|
- * @param int $code Error code.
|
|
|
- * @param string $message Error message.
|
|
|
- * @return void
|
|
|
- */
|
|
|
- protected function _connectionErrorHandler($code, $message)
|
|
|
- {
|
|
|
- $this->_connectionErrors[] = $message;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
* Get the context options
|
|
|
*
|
|
|
* Useful for debugging and testing context creation.
|