Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CurlMultiHandler.php

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\Handler

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal