function CurlMultiHandler::__get
Parameters
string $name:
Return value
resource|\CurlMultiHandle
Throws
\BadMethodCallException when another field as `_mh` will be gotten
\RuntimeException when curl can not initialize a multi handle
File
-
vendor/
guzzlehttp/ guzzle/ src/ Handler/ CurlMultiHandler.php, line 97
Class
- CurlMultiHandler
- Returns an asynchronous response using curl_multi_* functions.
Namespace
GuzzleHttp\HandlerCode
public function __get($name) {
if ($name !== '_mh') {
throw new \BadMethodCallException("Can not get other property as '_mh'.");
}
$multiHandle = \curl_multi_init();
if (false === $multiHandle) {
throw new \RuntimeException('Can not initialize curl multi handle.');
}
$this->_mh = $multiHandle;
foreach ($this->options as $option => $value) {
// A warning is raised in case of a wrong option.
curl_multi_setopt($this->_mh, $option, $value);
}
return $this->_mh;
}