OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
zzXpress
/
vendor
/
aws
/
aws-sdk-php
/
src
/
S3
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:23 AM
rwxr-xr-x
📄
AmbiguousSuccessParser.php
2.3 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
ApplyChecksumMiddleware.php
4.98 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
BatchDelete.php
7.73 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
BucketEndpointArnMiddleware.php
14.04 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
BucketEndpointMiddleware.php
3.44 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
CalculatesChecksumTrait.php
1.84 KB
05/19/2025 10:07:23 AM
rw-r--r--
📁
Crypto
-
05/19/2025 10:07:23 AM
rwxr-xr-x
📄
EndpointRegionHelperTrait.php
3.26 KB
05/19/2025 10:07:23 AM
rw-r--r--
📁
Exception
-
05/19/2025 10:07:23 AM
rwxr-xr-x
📄
GetBucketLocationParser.php
1.34 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
MultipartCopy.php
9.06 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
MultipartUploader.php
6.3 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
MultipartUploadingTrait.php
4.24 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
ObjectCopier.php
5.99 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
ObjectUploader.php
5.52 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
PermanentRedirectMiddleware.php
1.76 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
PostObject.php
3.99 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
PostObjectV4.php
5.49 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
PutObjectUrlMiddleware.php
1.61 KB
05/19/2025 10:07:23 AM
rw-r--r--
📁
RegionalEndpoint
-
05/19/2025 10:07:23 AM
rwxr-xr-x
📄
RetryableMalformedResponseParser.php
1.47 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
S3Client.php
52.19 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
S3ClientInterface.php
14.47 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
S3ClientTrait.php
10.56 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
S3EndpointMiddleware.php
11.39 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
S3MultiRegionClient.php
19.96 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
S3UriParser.php
5.07 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
SSECMiddleware.php
2.31 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
StreamWrapper.php
31.65 KB
05/19/2025 10:07:23 AM
rw-r--r--
📄
Transfer.php
15.58 KB
05/19/2025 10:07:23 AM
rw-r--r--
📁
UseArnRegion
-
05/19/2025 10:07:23 AM
rwxr-xr-x
📄
ValidateResponseChecksumParser.php
5.23 KB
05/19/2025 10:07:23 AM
rw-r--r--
Editing: ObjectCopier.php
Close
<?php namespace Aws\S3; use Aws\Arn\ArnParser; use Aws\Arn\S3\AccessPointArn; use Aws\Exception\MultipartUploadException; use Aws\Result; use Aws\S3\Exception\S3Exception; use GuzzleHttp\Promise\Coroutine; use GuzzleHttp\Promise\PromiseInterface; use GuzzleHttp\Promise\PromisorInterface; use InvalidArgumentException; /** * Copies objects from one S3 location to another, utilizing a multipart copy * when appropriate. */ class ObjectCopier implements PromisorInterface { const DEFAULT_MULTIPART_THRESHOLD = MultipartUploader::PART_MAX_SIZE; private $client; private $source; private $destination; private $acl; private $options; private static $defaults = [ 'before_lookup' => null, 'before_upload' => null, 'concurrency' => 5, 'mup_threshold' => self::DEFAULT_MULTIPART_THRESHOLD, 'params' => [], 'part_size' => null, 'version_id' => null, ]; /** * @param S3ClientInterface $client The S3 Client used to execute * the copy command(s). * @param array $source The object to copy, specified as * an array with a 'Bucket' and * 'Key' keys. Provide a * 'VersionID' key to copy a * specified version of an object. * @param array $destination The bucket and key to which to * copy the $source, specified as * an array with a 'Bucket' and * 'Key' keys. * @param string $acl ACL to apply to the copy * (default: private). * @param array $options Options used to configure the * copy process. Options passed in * through 'params' are added to * the sub commands. * * @throws InvalidArgumentException */ public function __construct( S3ClientInterface $client, array $source, array $destination, $acl = 'private', array $options = [] ) { $this->validateLocation($source); $this->validateLocation($destination); $this->client = $client; $this->source = $source; $this->destination = $destination; $this->acl = $acl; $this->options = $options + self::$defaults; } /** * Perform the configured copy asynchronously. Returns a promise that is * fulfilled with the result of the CompleteMultipartUpload or CopyObject * operation or rejected with an exception. * * @return Coroutine */ public function promise(): PromiseInterface { return Coroutine::of(function () { $headObjectCommand = $this->client->getCommand( 'HeadObject', $this->options['params'] + $this->source ); if (is_callable($this->options['before_lookup'])) { $this->options['before_lookup']($headObjectCommand); } $objectStats = (yield $this->client->executeAsync( $headObjectCommand )); if ($objectStats['ContentLength'] > $this->options['mup_threshold']) { $mup = new MultipartCopy( $this->client, $this->getSourcePath(), ['source_metadata' => $objectStats, 'acl' => $this->acl] + $this->destination + $this->options ); yield $mup->promise(); } else { $defaults = [ 'ACL' => $this->acl, 'MetadataDirective' => 'COPY', 'CopySource' => $this->getSourcePath(), ]; $params = array_diff_key($this->options, self::$defaults) + $this->destination + $defaults + $this->options['params']; yield $this->client->executeAsync( $this->client->getCommand('CopyObject', $params) ); } }); } /** * Perform the configured copy synchronously. Returns the result of the * CompleteMultipartUpload or CopyObject operation. * * @return Result * * @throws S3Exception * @throws MultipartUploadException */ public function copy() { return $this->promise()->wait(); } private function validateLocation(array $location) { if (empty($location['Bucket']) || empty($location['Key'])) { throw new \InvalidArgumentException('Locations provided to an' . ' Aws\S3\ObjectCopier must have a non-empty Bucket and Key'); } } private function getSourcePath() { $path = "/{$this->source['Bucket']}/"; if (ArnParser::isArn($this->source['Bucket'])) { try { new AccessPointArn($this->source['Bucket']); $path = "{$this->source['Bucket']}/object/"; } catch (\Exception $e) { throw new \InvalidArgumentException( 'Provided ARN was a not a valid S3 access point ARN (' . $e->getMessage() . ')', 0, $e ); } } $sourcePath = $path . rawurlencode($this->source['Key']); if (isset($this->source['VersionId'])) { $sourcePath .= "?versionId={$this->source['VersionId']}"; } return $sourcePath; } }