Open Journal Systems
3.3.0
CurlBackoffStrategy.php
1
<?php
2
3
namespace
Guzzle\Plugin\Backoff
;
4
5
use
Guzzle\Http\Message\RequestInterface
;
6
use
Guzzle\Http\Message\Response
;
7
use
Guzzle\Http\Exception\HttpException
;
8
use
Guzzle\Http\Exception\CurlException
;
9
13
class
CurlBackoffStrategy
extends
AbstractErrorCodeBackoffStrategy
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
plugins
paymethod
paypal
lib
vendor
guzzle
guzzle
src
Guzzle
Plugin
Backoff
CurlBackoffStrategy.php
Generated on Fri Aug 28 2020 14:51:21 for Open Journal Systems by
1.8.17