v2: Updates

* Simplifies & beautifies everything
* Introduces a new Class system.
* Errors are defaulted to AWS's handler.
* New function names & more efficient handling.
* Should fix a majority of the errors.

Please read the README for more!
This commit is contained in:
Devang Srivastava 2020-09-28 15:32:51 +05:30
parent ad0726e41e
commit e6d7753dc8
1095 changed files with 45088 additions and 2911 deletions

View file

@ -1,7 +1,6 @@
<?php
namespace Aws\S3;
use Aws\Api\Parser\PayloadParserTrait;
use Aws\CacheInterface;
use Aws\CommandInterface;
use Aws\LruArrayCache;
@ -51,6 +50,8 @@ use GuzzleHttp\Promise;
* @method \GuzzleHttp\Promise\Promise deleteObjectTaggingAsync(array $args = [])
* @method \Aws\Result deleteObjects(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteObjectsAsync(array $args = [])
* @method \Aws\Result deletePublicAccessBlock(array $args = [])
* @method \GuzzleHttp\Promise\Promise deletePublicAccessBlockAsync(array $args = [])
* @method \Aws\Result getBucketAccelerateConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBucketAccelerateConfigurationAsync(array $args = [])
* @method \Aws\Result getBucketAcl(array $args = [])
@ -79,6 +80,8 @@ use GuzzleHttp\Promise;
* @method \GuzzleHttp\Promise\Promise getBucketNotificationConfigurationAsync(array $args = [])
* @method \Aws\Result getBucketPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBucketPolicyAsync(array $args = [])
* @method \Aws\Result getBucketPolicyStatus(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBucketPolicyStatusAsync(array $args = [])
* @method \Aws\Result getBucketReplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBucketReplicationAsync(array $args = [])
* @method \Aws\Result getBucketRequestPayment(array $args = [])
@ -93,10 +96,18 @@ use GuzzleHttp\Promise;
* @method \GuzzleHttp\Promise\Promise getObjectAsync(array $args = [])
* @method \Aws\Result getObjectAcl(array $args = [])
* @method \GuzzleHttp\Promise\Promise getObjectAclAsync(array $args = [])
* @method \Aws\Result getObjectLegalHold(array $args = [])
* @method \GuzzleHttp\Promise\Promise getObjectLegalHoldAsync(array $args = [])
* @method \Aws\Result getObjectLockConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getObjectLockConfigurationAsync(array $args = [])
* @method \Aws\Result getObjectRetention(array $args = [])
* @method \GuzzleHttp\Promise\Promise getObjectRetentionAsync(array $args = [])
* @method \Aws\Result getObjectTagging(array $args = [])
* @method \GuzzleHttp\Promise\Promise getObjectTaggingAsync(array $args = [])
* @method \Aws\Result getObjectTorrent(array $args = [])
* @method \GuzzleHttp\Promise\Promise getObjectTorrentAsync(array $args = [])
* @method \Aws\Result getPublicAccessBlock(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPublicAccessBlockAsync(array $args = [])
* @method \Aws\Result headBucket(array $args = [])
* @method \GuzzleHttp\Promise\Promise headBucketAsync(array $args = [])
* @method \Aws\Result headObject(array $args = [])
@ -159,10 +170,20 @@ use GuzzleHttp\Promise;
* @method \GuzzleHttp\Promise\Promise putObjectAsync(array $args = [])
* @method \Aws\Result putObjectAcl(array $args = [])
* @method \GuzzleHttp\Promise\Promise putObjectAclAsync(array $args = [])
* @method \Aws\Result putObjectLegalHold(array $args = [])
* @method \GuzzleHttp\Promise\Promise putObjectLegalHoldAsync(array $args = [])
* @method \Aws\Result putObjectLockConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putObjectLockConfigurationAsync(array $args = [])
* @method \Aws\Result putObjectRetention(array $args = [])
* @method \GuzzleHttp\Promise\Promise putObjectRetentionAsync(array $args = [])
* @method \Aws\Result putObjectTagging(array $args = [])
* @method \GuzzleHttp\Promise\Promise putObjectTaggingAsync(array $args = [])
* @method \Aws\Result putPublicAccessBlock(array $args = [])
* @method \GuzzleHttp\Promise\Promise putPublicAccessBlockAsync(array $args = [])
* @method \Aws\Result restoreObject(array $args = [])
* @method \GuzzleHttp\Promise\Promise restoreObjectAsync(array $args = [])
* @method \Aws\Result selectObjectContent(array $args = [])
* @method \GuzzleHttp\Promise\Promise selectObjectContentAsync(array $args = [])
* @method \Aws\Result uploadPart(array $args = [])
* @method \GuzzleHttp\Promise\Promise uploadPartAsync(array $args = [])
* @method \Aws\Result uploadPartCopy(array $args = [])
@ -245,7 +266,7 @@ class S3MultiRegionClient extends BaseClient implements S3ClientInterface
} catch (AwsException $e) {
if ($e->getAwsErrorCode() === 'AuthorizationHeaderMalformed') {
$region = $this->determineBucketRegionFromExceptionBody(
$e->getResponse()->getBody()
$e->getResponse()
);
if (!empty($region)) {
$this->cache->set($cacheKey, $region);
@ -264,7 +285,7 @@ class S3MultiRegionClient extends BaseClient implements S3ClientInterface
};
}
public function createPresignedRequest(CommandInterface $command, $expires)
public function createPresignedRequest(CommandInterface $command, $expires, array $options = [])
{
if (empty($command['Bucket'])) {
throw new \InvalidArgumentException('The S3\\MultiRegionClient'