public function CurlHandle::__construct

Construct a new CurlHandle object that wraps a cURL handle

Parameters

resource $handle Configured cURL handle resource:

Collection|array $options Curl options to use with the handle:

Throws

InvalidArgumentException

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlHandle.php, line 237

Class

CurlHandle
Immutable wrapper for a cURL handle

Namespace

Guzzle\Http\Curl

Code

public function __construct($handle, $options) {
  if (!is_resource($handle)) {
    throw new InvalidArgumentException('Invalid handle provided');
  }
  if (is_array($options)) {
    $this->options = new Collection($options);
  }
  elseif ($options instanceof Collection) {
    $this->options = $options;
  }
  else {
    throw new InvalidArgumentException('Expected array or Collection');
  }
  $this->handle = $handle;
}