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,6 +1,8 @@
<?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;
@ -139,8 +141,20 @@ class ObjectCopier implements PromisorInterface
private function getSourcePath()
{
$sourcePath = "/{$this->source['Bucket']}/"
. rawurlencode($this->source['Key']);
if (ArnParser::isArn($this->source['Bucket'])) {
try {
new AccessPointArn($this->source['Bucket']);
} catch (\Exception $e) {
throw new \InvalidArgumentException(
'Provided ARN was a not a valid S3 access point ARN ('
. $e->getMessage() . ')',
0,
$e
);
}
}
$sourcePath = "/{$this->source['Bucket']}/" . rawurlencode($this->source['Key']);
if (isset($this->source['VersionId'])) {
$sourcePath .= "?versionId={$this->source['VersionId']}";
}