GuzzleHttpHandlerCurlHandler

HTTP handler that uses cURL easy handles as a transport layer.

Defined (1)

The class is defined in the following location(s).

/lib/Azure/GuzzleHttp/Handler/CurlHandler.php  
  1. class CurlHandler 
  2. /** @var CurlFactoryInterface */ 
  3. private $factory; 
  4.  
  5. /** 
  6. * Accepts an associative array of options: 
  7. * - factory: Optional curl factory used to create cURL handles. 
  8. * @param array $options Array of options to use with the handler 
  9. */ 
  10. public function __construct(array $options = []) 
  11. $this->factory = isset($options['handle_factory']) 
  12. ? $options['handle_factory'] 
  13. : new CurlFactory(3); 
  14.  
  15. public function __invoke(RequestInterface $request, array $options) 
  16. if (isset($options['delay'])) { 
  17. usleep($options['delay'] * 1000); 
  18.  
  19. $easy = $this->factory->create($request, $options); 
  20. curl_exec($easy->handle); 
  21. $easy->errno = curl_errno($easy->handle); 
  22.  
  23. return CurlFactory::finish($this, $easy, $this->factory);