Skip to content

Commit

Permalink
Refactored PR to take all options into account during copy actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Jun 20, 2016
1 parent a7ff1dc commit 2931850
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/AwsS3Adapter.php
Expand Up @@ -377,22 +377,15 @@ public function updateStream($path, $resource, Config $config)
*/
public function copy($path, $newpath)
{
$visibility = $this->getRawVisibility($path);

$args = [
$command = $this->s3Client->getCommand(
'copyObject',
[
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($newpath),
'CopySource' => urlencode($this->bucket . '/' . $this->applyPathPrefix($path)),
'ACL' => $visibility === AdapterInterface::VISIBILITY_PUBLIC ? 'public-read' : 'private',
];

if (isset($this->options['ServerSideEncryption'])) {
$args['ServerSideEncryption'] = $this->options['ServerSideEncryption'];
}

$command = $this->s3Client->getCommand(
'copyObject',
$args
'ACL' => $this->getRawVisibility($path) === AdapterInterface::VISIBILITY_PUBLIC
? 'public-read' : 'private',
] + $this->options
);

try {
Expand Down

0 comments on commit 2931850

Please sign in to comment.