summaryrefslogtreecommitdiff
path: root/vendor/aws/aws-sdk-php/src/S3/Transfer.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-10-20 16:44:35 +0300
committerAndrew Dolgov <[email protected]>2023-10-20 16:44:35 +0300
commit8bec661288b276c98bdb0e773e5f4d5275dc4c87 (patch)
tree8617ebe581c62fc46a7881aa61801ebce9d3c603 /vendor/aws/aws-sdk-php/src/S3/Transfer.php
parent540438c2eb5452bacad30c247906bfa287f2da1d (diff)
update AWK SDKHEADmaster
Diffstat (limited to 'vendor/aws/aws-sdk-php/src/S3/Transfer.php')
-rw-r--r--vendor/aws/aws-sdk-php/src/S3/Transfer.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/aws/aws-sdk-php/src/S3/Transfer.php b/vendor/aws/aws-sdk-php/src/S3/Transfer.php
index 68b6736..600f441 100644
--- a/vendor/aws/aws-sdk-php/src/S3/Transfer.php
+++ b/vendor/aws/aws-sdk-php/src/S3/Transfer.php
@@ -27,6 +27,7 @@ class Transfer implements PromisorInterface
private $mupThreshold;
private $before;
private $s3Args = [];
+ private $addContentMD5;
/**
* When providing the $source argument, you may provide a string referencing
@@ -134,6 +135,10 @@ class Transfer implements PromisorInterface
$this->addDebugToBefore($options['debug']);
}
}
+
+ // Handle "add_content_md5" option.
+ $this->addContentMD5 = isset($options['add_content_md5'])
+ && $options['add_content_md5'] === true;
}
/**
@@ -141,7 +146,7 @@ class Transfer implements PromisorInterface
*
* @return PromiseInterface
*/
- public function promise()
+ public function promise(): PromiseInterface
{
// If the promise has been created, just return it.
if (!$this->promise) {
@@ -342,6 +347,7 @@ class Transfer implements PromisorInterface
$args = $this->s3Args;
$args['SourceFile'] = $filename;
$args['Key'] = $this->createS3Key($filename);
+ $args['AddContentMD5'] = $this->addContentMD5;
$command = $this->client->getCommand('PutObject', $args);
$this->before and call_user_func($this->before, $command);
@@ -361,6 +367,7 @@ class Transfer implements PromisorInterface
'before_upload' => $this->before,
'before_complete' => $this->before,
'concurrency' => $this->concurrency,
+ 'add_content_md5' => $this->addContentMD5
]))->promise();
}