Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • AbstractBackoffStrategy
  • AbstractErrorCodeBackoffStrategy
  • BackoffLogger
  • BackoffPlugin
  • CallbackBackoffStrategy
  • ConstantBackoffStrategy
  • CurlBackoffStrategy
  • ExponentialBackoffStrategy
  • HttpBackoffStrategy
  • LinearBackoffStrategy
  • ReasonPhraseBackoffStrategy
  • TruncatedBackoffStrategy

Interfaces

  • BackoffStrategyInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 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: 
10: /**
11:  * Strategy used to retry when certain cURL error codes are encountered.
12:  */
13: class CurlBackoffStrategy extends AbstractErrorCodeBackoffStrategy
14: {
15:     /**
16:      * @var array Default cURL errors to retry
17:      */
18:     protected static $defaultErrorCodes = array(
19:         CURLE_COULDNT_RESOLVE_HOST, CURLE_COULDNT_CONNECT, CURLE_WRITE_ERROR, CURLE_READ_ERROR,
20:         CURLE_OPERATION_TIMEOUTED, CURLE_SSL_CONNECT_ERROR, CURLE_HTTP_PORT_FAILED, CURLE_GOT_NOTHING,
21:         CURLE_SEND_ERROR, CURLE_RECV_ERROR
22:     );
23: 
24:     /**
25:      * {@inheritdoc}
26:      */
27:     protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null)
28:     {
29:         if ($e && $e instanceof CurlException) {
30:             return isset($this->errorCodes[$e->getErrorNo()]) ? true : null;
31:         }
32:     }
33: }
34: 
php-coveralls API documentation generated by ApiGen 2.8.0