Open Journal Systems  3.3.0
CurlBackoffStrategy.php
1 <?php
2 
3 namespace Guzzle\Plugin\Backoff;
4 
9 
14 {
16  protected static $defaultErrorCodes = array(
17  CURLE_COULDNT_RESOLVE_HOST, CURLE_COULDNT_CONNECT, CURLE_PARTIAL_FILE, CURLE_WRITE_ERROR, CURLE_READ_ERROR,
18  CURLE_OPERATION_TIMEOUTED, CURLE_SSL_CONNECT_ERROR, CURLE_HTTP_PORT_FAILED, CURLE_GOT_NOTHING,
19  CURLE_SEND_ERROR, CURLE_RECV_ERROR
20  );
21 
22  protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null)
23  {
24  if ($e && $e instanceof CurlException) {
25  return isset($this->errorCodes[$e->getErrorNo()]) ? true : null;
26  }
27  }
28 }
Guzzle\Http\Exception\CurlException
Definition: CurlException.php:10
Guzzle\Http\Message\RequestInterface
Definition: lib/vendor/guzzle/guzzle/src/Guzzle/Http/Message/RequestInterface.php:16
Guzzle\Http\Exception\HttpException
Definition: lib/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/HttpException.php:10
Guzzle\Plugin\Backoff\CurlBackoffStrategy\$defaultErrorCodes
static $defaultErrorCodes
Definition: CurlBackoffStrategy.php:16
Guzzle\Http\Message\Response
Definition: lib/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Response.php:17
Guzzle\Plugin\Backoff
Definition: AbstractBackoffStrategy.php:3
Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy
Definition: AbstractErrorCodeBackoffStrategy.php:8
Guzzle\Plugin\Backoff\CurlBackoffStrategy\getDelay
getDelay($retries, RequestInterface $request, Response $response=null, HttpException $e=null)
Definition: CurlBackoffStrategy.php:22
Guzzle\Plugin\Backoff\CurlBackoffStrategy
Definition: CurlBackoffStrategy.php:13