hello
Server : Apache System : Linux webm006.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : chryzalihi ( 621211) PHP Version : 8.3.31 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Directory : /home/chryzalihi/www/wp-content/languages/themes/the/ |
TruncatedBackoffStrategy.php 0000604 00000001717 15244332550 0012212 0 ustar 00 <?php
namespace Guzzle\Plugin\Backoff;
use Guzzle\Http\Message\RequestInterface;
use Guzzle\Http\Message\Response;
use Guzzle\Http\Exception\HttpException;
/**
* Strategy that will not retry more than a certain number of times.
*/
class TruncatedBackoffStrategy extends AbstractBackoffStrategy
{
/** @var int Maximum number of retries per request */
protected $max;
/**
* @param int $maxRetries Maximum number of retries per request
* @param BackoffStrategyInterface $next The optional next strategy
*/
public function __construct($maxRetries, BackoffStrategyInterface $next = null)
{
$this->max = $maxRetries;
$this->next = $next;
}
public function makesDecision()
{
return true;
}
protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null)
{
return $retries < $this->max ? null : false;
}
}
BackoffLogger.php 0000604 00000004421 15244332550 0007750 0 ustar 00 <?php
namespace Guzzle\Plugin\Backoff;
use Guzzle\Common\Event;
use Guzzle\Log\LogAdapterInterface;
use Guzzle\Log\MessageFormatter;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* Logs backoff retries triggered from the BackoffPlugin
*
* Format your log messages using a template that can contain template substitutions found in {@see MessageFormatter}.
* In addition to the default template substitutions, there is also:
*
* - retries: The number of times the request has been retried
* - delay: The amount of time the request is being delayed
*/
class BackoffLogger implements EventSubscriberInterface
{
/** @var string Default log message template */
const DEFAULT_FORMAT = '[{ts}] {method} {url} - {code} {phrase} - Retries: {retries}, Delay: {delay}, Time: {connect_time}, {total_time}, cURL: {curl_code} {curl_error}';
/** @var LogAdapterInterface Logger used to log retries */
protected $logger;
/** @var MessageFormatter Formatter used to format log messages */
protected $formatter;
/**
* @param LogAdapterInterface $logger Logger used to log the retries
* @param MessageFormatter $formatter Formatter used to format log messages
*/
public function __construct(LogAdapterInterface $logger, MessageFormatter $formatter = null)
{
$this->logger = $logger;
$this->formatter = $formatter ?: new MessageFormatter(self::DEFAULT_FORMAT);
}
public static function getSubscribedEvents()
{
return array(BackoffPlugin::RETRY_EVENT => 'onRequestRetry');
}
/**
* Set the template to use for logging
*
* @param string $template Log message template
*
* @return self
*/
public function setTemplate($template)
{
$this->formatter->setTemplate($template);
return $this;
}
/**
* Called when a request is being retried
*
* @param Event $event Event emitted
*/
public function onRequestRetry(Event $event)
{
$this->logger->log($this->formatter->format(
$event['request'],
$event['response'],
$event['handle'],
array(
'retries' => $event['retries'],
'delay' => $event['delay']
)
));
}
}
HttpBackoffStrategy.php 0000604 00000001606 15244332550 0011175 0 ustar 00 <?php
namespace Guzzle\Plugin\Backoff;
use Guzzle\Http\Message\RequestInterface;
use Guzzle\Http\Message\Response;
use Guzzle\Http\Exception\HttpException;
/**
* Strategy used to retry HTTP requests based on the response code.
*
* Retries 500 and 503 error by default.
*/
class HttpBackoffStrategy extends AbstractErrorCodeBackoffStrategy
{
/** @var array Default cURL errors to retry */
protected static $defaultErrorCodes = array(500, 503);
protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null)
{
if ($response) {
//Short circuit the rest of the checks if it was successful
if ($response->isSuccessful()) {
return false;
} else {
return isset($this->errorCodes[$response->getStatusCode()]) ? true : null;
}
}
}
}
CurlBackoffStrategy.php 0000604 00000001737 15244332550 0011170 0 ustar 00 <?php
namespace Guzzle\Plugin\Backoff;
use Guzzle\Http\Message\RequestInterface;
use Guzzle\Http\Message\Response;
use Guzzle\Http\Exception\HttpException;
use Guzzle\Http\Exception\CurlException;
/**
* Strategy used to retry when certain cURL error codes are encountered.
*/
class CurlBackoffStrategy extends AbstractErrorCodeBackoffStrategy
{
/** @var array Default cURL errors to retry */
protected static $defaultErrorCodes = array(
CURLE_COULDNT_RESOLVE_HOST, CURLE_COULDNT_CONNECT, CURLE_PARTIAL_FILE, CURLE_WRITE_ERROR, CURLE_READ_ERROR,
CURLE_OPERATION_TIMEOUTED, CURLE_SSL_CONNECT_ERROR, CURLE_HTTP_PORT_FAILED, CURLE_GOT_NOTHING,
CURLE_SEND_ERROR, CURLE_RECV_ERROR
);
protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null)
{
if ($e && $e instanceof CurlException) {
return isset($this->errorCodes[$e->getErrorNo()]) ? true : null;
}
}
}
.htaccess 0000444 00000000424 15244332550 0006343 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
Deny from all
</FilesMatch>
</IfModule>