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/ |
composer.json 0000604 00000001365 15244500603 0007266 0 ustar 00 {
"name": "guzzle/plugin-error-response",
"description": "Guzzle errorResponse plugin for creating error exceptions based on a service description",
"homepage": "http://guzzlephp.org/",
"keywords": ["plugin", "guzzle"],
"license": "MIT",
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"require": {
"php": ">=5.3.2",
"guzzle/service": "self.version"
},
"autoload": {
"psr-0": { "Guzzle\\Plugin\\ErrorResponse": "" }
},
"target-dir": "Guzzle/Plugin/ErrorResponse",
"extra": {
"branch-alias": {
"dev-master": "3.7-dev"
}
}
}
ErrorResponsePlugin.php 0000604 00000005366 15244500603 0011251 0 ustar 00 <?php
namespace Guzzle\Plugin\ErrorResponse;
use Guzzle\Common\Event;
use Guzzle\Http\Message\RequestInterface;
use Guzzle\Service\Command\CommandInterface;
use Guzzle\Service\Description\Operation;
use Guzzle\Plugin\ErrorResponse\Exception\ErrorResponseException;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* Converts generic Guzzle response exceptions into errorResponse exceptions
*/
class ErrorResponsePlugin implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array('command.before_send' => array('onCommandBeforeSend', -1));
}
/**
* Adds a listener to requests before they sent from a command
*
* @param Event $event Event emitted
*/
public function onCommandBeforeSend(Event $event)
{
$command = $event['command'];
if ($operation = $command->getOperation()) {
if ($operation->getErrorResponses()) {
$request = $command->getRequest();
$request->getEventDispatcher()
->addListener('request.complete', $this->getErrorClosure($request, $command, $operation));
}
}
}
/**
* @param RequestInterface $request Request that received an error
* @param CommandInterface $command Command that created the request
* @param Operation $operation Operation that defines the request and errors
*
* @return \Closure Returns a closure
* @throws ErrorResponseException
*/
protected function getErrorClosure(RequestInterface $request, CommandInterface $command, Operation $operation)
{
return function (Event $event) use ($request, $command, $operation) {
$response = $event['response'];
foreach ($operation->getErrorResponses() as $error) {
if (!isset($error['class'])) {
continue;
}
if (isset($error['code']) && $response->getStatusCode() != $error['code']) {
continue;
}
if (isset($error['reason']) && $response->getReasonPhrase() != $error['reason']) {
continue;
}
$className = $error['class'];
$errorClassInterface = __NAMESPACE__ . '\\ErrorResponseExceptionInterface';
if (!class_exists($className)) {
throw new ErrorResponseException("{$className} does not exist");
} elseif (!is_subclass_of($className, $errorClassInterface)) {
throw new ErrorResponseException("{$className} must implement {$errorClassInterface}");
}
throw $className::fromCommand($command, $response);
}
};
}
}
ErrorResponseExceptionInterface.php 0000604 00000001126 15244500603 0013560 0 ustar 00 <?php
namespace Guzzle\Plugin\ErrorResponse;
use Guzzle\Service\Command\CommandInterface;
use Guzzle\Http\Message\Response;
/**
* Interface used to create an exception from an error response
*/
interface ErrorResponseExceptionInterface
{
/**
* Create an exception for a command based on a command and an error response definition
*
* @param CommandInterface $command Command that was sent
* @param Response $response The error response
*
* @return self
*/
public static function fromCommand(CommandInterface $command, Response $response);
}
Exception/ErrorResponseException.php 0000604 00000000241 15244500603 0013672 0 ustar 00 <?php
namespace Guzzle\Plugin\ErrorResponse\Exception;
use Guzzle\Common\Exception\RuntimeException;
class ErrorResponseException extends RuntimeException {}
Exception/.htaccess 0000444 00000000424 15244500603 0010275 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>