Copied!

Creates curl resources from a request

  • final
CloneableInstantiable
Constants
public GuzzleHttp\Handler\CurlFactory::CURL_VERSION_STR = 'curl_version'
public GuzzleHttp\Handler\CurlFactory::LOW_CURL_VERSION_NUMBER = '7.21.2'
 
  • deprecated
Methods
public __construct(int $maxHandles)
 
  • param int $maxHandles Maximum number of idle handles.
public __destruct()
public create(Psr\Http\Message\RequestInterface $request, array $options) : GuzzleHttp\Handler\EasyHandle
public static finish(callable $handler, GuzzleHttp\Handler\EasyHandle $easy, GuzzleHttp\Handler\CurlFactoryInterface $factory) : GuzzleHttp\Promise\PromiseInterface
 

Completes a cURL transaction, either returning a response promise or a rejected promise.

  • param callable $handler
  • param \CurlFactoryInterface $factory Dictates how the handle is released
public release(GuzzleHttp\Handler\EasyHandle $easy) : void
Properties
private $handles = []
 
  • var resource[]|\CurlHandle[]
private $maxHandles = NULL
 
  • var int Total number of idle handles to keep in cache
Methods
private applyBody(Psr\Http\Message\RequestInterface $request, array $options, array $conf) : void
private applyHandlerOptions(GuzzleHttp\Handler\EasyHandle $easy, array $conf) : void
private applyHeaders(GuzzleHttp\Handler\EasyHandle $easy, array $conf) : void
private applyMethod(GuzzleHttp\Handler\EasyHandle $easy, array $conf) : void
private createHeaderFn(GuzzleHttp\Handler\EasyHandle $easy) : callable
private static createRejection(GuzzleHttp\Handler\EasyHandle $easy, array $ctx) : GuzzleHttp\Promise\PromiseInterface
private static finishError(callable $handler, GuzzleHttp\Handler\EasyHandle $easy, GuzzleHttp\Handler\CurlFactoryInterface $factory) : GuzzleHttp\Promise\PromiseInterface
 
  • param callable $handler
private getDefaultConf(GuzzleHttp\Handler\EasyHandle $easy) : array
 
  • return array<int|string,mixed>
private static invokeStats(GuzzleHttp\Handler\EasyHandle $easy) : void
private removeHeader(string $name, array $options) : void
 

Remove a header from the options array.

  • param string $name Case-insensitive header to remove
  • param array $options Array of options to modify
private static retryFailedRewind(callable $handler, GuzzleHttp\Handler\EasyHandle $easy, array $ctx) : GuzzleHttp\Promise\PromiseInterface
 

This function ensures that a response was set on a transaction. If one was not set, then the request is retried if possible. This error typically means you are sending a payload, curl encountered a "Connection died, retrying a fresh connect" error, tried to rewind the stream, and then encountered a "necessary data rewind wasn't possible" error, causing the request to be sent through curl_multi_info_read() without an error status.

  • param callable $handler
Methods
private static createRejection(GuzzleHttp\Handler\EasyHandle $easy, array $ctx) : GuzzleHttp\Promise\PromiseInterface
public static finish(callable $handler, GuzzleHttp\Handler\EasyHandle $easy, GuzzleHttp\Handler\CurlFactoryInterface $factory) : GuzzleHttp\Promise\PromiseInterface
 

Completes a cURL transaction, either returning a response promise or a rejected promise.

  • param callable $handler
  • param \CurlFactoryInterface $factory Dictates how the handle is released
private static finishError(callable $handler, GuzzleHttp\Handler\EasyHandle $easy, GuzzleHttp\Handler\CurlFactoryInterface $factory) : GuzzleHttp\Promise\PromiseInterface
 
  • param callable $handler
private static invokeStats(GuzzleHttp\Handler\EasyHandle $easy) : void
private static retryFailedRewind(callable $handler, GuzzleHttp\Handler\EasyHandle $easy, array $ctx) : GuzzleHttp\Promise\PromiseInterface
 

This function ensures that a response was set on a transaction. If one was not set, then the request is retried if possible. This error typically means you are sending a payload, curl encountered a "Connection died, retrying a fresh connect" error, tried to rewind the stream, and then encountered a "necessary data rewind wasn't possible" error, causing the request to be sent through curl_multi_info_read() without an error status.

  • param callable $handler
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration