X7ROOT File Manager
Current Path:
/home/katmhsmi/public_html/wp-content/plugins/duplicator-pro/aws/Aws/S3
home
/
katmhsmi
/
public_html
/
wp-content
/
plugins
/
duplicator-pro
/
aws
/
Aws
/
S3
/
📁
..
📄
.htaccess
(420 B)
📄
AcpListener.php
(2.67 KB)
📄
BucketStyleListener.php
(3.33 KB)
📁
Command
📁
Enum
📁
Exception
📄
IncompleteMultipartUploadChecker.php
(2.09 KB)
📁
Iterator
📁
Model
📁
Resources
📄
ResumableDownload.php
(6.37 KB)
📄
S3Client.php
(32.55 KB)
📄
S3Md5Listener.php
(2.48 KB)
📄
S3Signature.php
(9.44 KB)
📄
S3SignatureInterface.php
(829 B)
📄
S3SignatureV4.php
(1.96 KB)
📄
SocketTimeoutChecker.php
(2.4 KB)
📄
SseCpkListener.php
(2.27 KB)
📄
StreamWrapper.php
(28.72 KB)
📁
Sync
📄
index.php
(15 B)
Editing: S3Md5Listener.php
<?php /** * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace DuplicatorPro\Aws\S3; defined("ABSPATH") or die(""); use DuplicatorPro\Aws\Common\Signature\SignatureV4; use DuplicatorPro\Aws\Common\Signature\SignatureInterface; use DuplicatorPro\Guzzle\Common\Event; use DuplicatorPro\Guzzle\Service\Command\CommandInterface; use DuplicatorPro\Symfony\Component\EventDispatcher\EventSubscriberInterface; /** * Adds required and optional Content-MD5 headers */ class S3Md5Listener implements EventSubscriberInterface { /** @var S3SignatureInterface */ private $signature; public static function getSubscribedEvents() { return array('command.after_prepare' => 'onCommandAfterPrepare'); } public function __construct(SignatureInterface $signature) { $this->signature = $signature; } public function onCommandAfterPrepare(Event $event) { $command = $event['command']; $operation = $command->getOperation(); if ($operation->getData('contentMd5')) { // Add the MD5 if it is required for all signers $this->addMd5($command); } elseif ($operation->hasParam('ContentMD5')) { $value = $command['ContentMD5']; // Add a computed MD5 if the parameter is set to true or if // not using Signature V4 and the value is not set (null). if ($value === true || ($value === null && !($this->signature instanceof SignatureV4)) ) { $this->addMd5($command); } } } private function addMd5(CommandInterface $command) { $request = $command->getRequest(); $body = $request->getBody(); if ($body && $body->getSize() > 0) { if (false !== ($md5 = $body->getContentMd5(true, true))) { $request->setHeader('Content-MD5', $md5); } } } }
Upload File
Create Folder