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/c/h/r/chryzalihi/www/wp-content/languages/themes/the/ |
CommandContentMd5Plugin.php 0000604 00000004235 15244335540 0011720 0 ustar 00 <?php
namespace Guzzle\Plugin\Md5;
use Guzzle\Common\Event;
use Guzzle\Http\Message\EntityEnclosingRequestInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* Listener used to add a ContentMD5 header to the body of a command and adds ContentMD5 validation if the
* ValidateMD5 option is not set to false on a command
*/
class CommandContentMd5Plugin implements EventSubscriberInterface
{
/** @var string Parameter used to check if the ContentMD5 value is being added */
protected $contentMd5Param;
/** @var string Parameter used to check if validation should occur on the response */
protected $validateMd5Param;
/**
* @param string $contentMd5Param Parameter used to check if the ContentMD5 value is being added
* @param string $validateMd5Param Parameter used to check if validation should occur on the response
*/
public function __construct($contentMd5Param = 'ContentMD5', $validateMd5Param = 'ValidateMD5')
{
$this->contentMd5Param = $contentMd5Param;
$this->validateMd5Param = $validateMd5Param;
}
public static function getSubscribedEvents()
{
return array('command.before_send' => array('onCommandBeforeSend', -255));
}
public function onCommandBeforeSend(Event $event)
{
$command = $event['command'];
$request = $command->getRequest();
// Only add an MD5 is there is a MD5 option on the operation and it has a payload
if ($request instanceof EntityEnclosingRequestInterface && $request->getBody()
&& $command->getOperation()->hasParam($this->contentMd5Param)) {
// Check if an MD5 checksum value should be passed along to the request
if ($command[$this->contentMd5Param] === true) {
if (false !== ($md5 = $request->getBody()->getContentMd5(true, true))) {
$request->setHeader('Content-MD5', $md5);
}
}
}
// Check if MD5 validation should be used with the response
if ($command[$this->validateMd5Param] === true) {
$request->addSubscriber(new Md5ValidatorPlugin(true, false));
}
}
}
composer.json 0000604 00000001215 15244335540 0007266 0 ustar 00 {
"name": "guzzle/plugin-md5",
"description": "Guzzle MD5 plugins",
"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/http": "self.version"
},
"autoload": {
"psr-0": { "Guzzle\\Plugin\\Md5": "" }
},
"target-dir": "Guzzle/Plugin/Md5",
"extra": {
"branch-alias": {
"dev-master": "3.7-dev"
}
}
}
.htaccess 0000444 00000000424 15244335540 0006345 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>