/home/techb158/immovalet.com/vendor/aws/aws-sdk-php/src/S3
NameSizeModeActions
Crypto/-0755rm
Exception/-0755rm
RegionalEndpoint/-0755rm
UseArnRegion/-0755rm
AmbiguousSuccessParser.php22800644editdlrm
ApplyChecksumMiddleware.php19040644editdlrm
BatchDelete.php75810644editdlrm
BucketEndpointArnMiddleware.php118720644editdlrm
BucketEndpointMiddleware.php19140644editdlrm
EndpointRegionHelperTrait.php38780644editdlrm
GetBucketLocationParser.php13200644editdlrm
MultipartCopy.php69340644editdlrm
MultipartUploader.php61160644editdlrm
MultipartUploadingTrait.php39510644editdlrm
ObjectCopier.php57700644editdlrm
ObjectUploader.php51460644editdlrm
PermanentRedirectMiddleware.php17420644editdlrm
PostObject.php39270644editdlrm
PostObjectV4.php54300644editdlrm
PutObjectUrlMiddleware.php15690644editdlrm
RetryableMalformedResponseParser.php14530644editdlrm
S3Client.php429670644editdlrm
S3ClientInterface.php123290644editdlrm
S3ClientTrait.php84990644editdlrm
S3EndpointMiddleware.php114620644editdlrm
S3MultiRegionClient.php196430644editdlrm
S3UriParser.php50270644editdlrm
SSECMiddleware.php22890644editdlrm
StreamWrapper.php305980644editdlrm
Transfer.php151620644editdlrm
Edit: /home/techb158/immovalet.com/vendor/aws/aws-sdk-php/src/S3/S3MultiRegionClient.php (19643B)
function (array &$args) { $availableRegions = array_keys($args['partition']['regions']); return end($availableRegions); }]; unset($args['region']); return $args + [ 'bucket_region_cache' => [ 'type' => 'config', 'valid' => [CacheInterface::class], 'doc' => 'Cache of regions in which given buckets are located.', 'default' => function () { return new LruArrayCache; }, ], 'region' => $regionDef, ]; } public function __construct(array $args) { parent::__construct($args); $this->cache = $this->getConfig('bucket_region_cache'); $this->getHandlerList()->prependInit( $this->determineRegionMiddleware(), 'determine_region' ); } private function determineRegionMiddleware() { return function (callable $handler) { return function (CommandInterface $command) use ($handler) { $cacheKey = $this->getCacheKey($command['Bucket']); if ( empty($command['@region']) && $region = $this->cache->get($cacheKey) ) { $command['@region'] = $region; } return Promise\coroutine(function () use ( $handler, $command, $cacheKey ) { try { yield $handler($command); } catch (PermanentRedirectException $e) { if (empty($command['Bucket'])) { throw $e; } $result = $e->getResult(); $region = null; if (isset($result['@metadata']['headers']['x-amz-bucket-region'])) { $region = $result['@metadata']['headers']['x-amz-bucket-region']; $this->cache->set($cacheKey, $region); } else { $region = (yield $this->determineBucketRegionAsync( $command['Bucket'] )); } $command['@region'] = $region; yield $handler($command); } catch (AwsException $e) { if ($e->getAwsErrorCode() === 'AuthorizationHeaderMalformed') { $region = $this->determineBucketRegionFromExceptionBody( $e->getResponse() ); if (!empty($region)) { $this->cache->set($cacheKey, $region); $command['@region'] = $region; yield $handler($command); } else { throw $e; } } else { throw $e; } } }); }; }; } public function createPresignedRequest(CommandInterface $command, $expires, array $options = []) { if (empty($command['Bucket'])) { throw new \InvalidArgumentException('The S3\\MultiRegionClient' . ' cannot create presigned requests for commands without a' . ' specified bucket.'); } /** @var S3ClientInterface $client */ $client = $this->getClientFromPool( $this->determineBucketRegion($command['Bucket']) ); return $client->createPresignedRequest( $client->getCommand($command->getName(), $command->toArray()), $expires ); } public function getObjectUrl($bucket, $key) { /** @var S3Client $regionalClient */ $regionalClient = $this->getClientFromPool( $this->determineBucketRegion($bucket) ); return $regionalClient->getObjectUrl($bucket, $key); } public function determineBucketRegionAsync($bucketName) { $cacheKey = $this->getCacheKey($bucketName); if ($cached = $this->cache->get($cacheKey)) { return Promise\promise_for($cached); } /** @var S3ClientInterface $regionalClient */ $regionalClient = $this->getClientFromPool(); return $regionalClient->determineBucketRegionAsync($bucketName) ->then( function ($region) use ($cacheKey) { $this->cache->set($cacheKey, $region); return $region; } ); } private function getCacheKey($bucketName) { return "aws:s3:{$bucketName}:location"; } }