aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model')
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Acp.php243
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/AcpBuilder.php134
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/ClearBucket.php189
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/DeleteObjectsBatch.php87
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/DeleteObjectsTransfer.php133
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Grant.php139
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Grantee.php245
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/AbstractTransfer.php103
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/ParallelTransfer.php124
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/SerialTransfer.php86
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/TransferState.php41
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadBuilder.php297
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadId.php35
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadPart.php74
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/PostObject.php275
15 files changed, 0 insertions, 2205 deletions
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Acp.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Acp.php
deleted file mode 100644
index 6c19f668400..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Acp.php
+++ /dev/null
@@ -1,243 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model;
-
-use Aws\Common\Exception\InvalidArgumentException;
-use Aws\Common\Exception\OverflowException;
-use Guzzle\Common\ToArrayInterface;
-use Guzzle\Service\Command\AbstractCommand;
-
-/**
- * Amazon S3 Access Control Policy (ACP)
- */
-class Acp implements ToArrayInterface, \IteratorAggregate, \Countable
-{
- /**
- * @var \SplObjectStorage List of grants on the ACP
- */
- protected $grants = array();
-
- /**
- * @var Grantee The owner of the ACP
- */
- protected $owner;
-
- /**
- * Constructs an ACP
- *
- * @param Grantee $owner ACP policy owner
- * @param array|\Traversable $grants List of grants for the ACP
- */
- public function __construct(Grantee $owner, $grants = null)
- {
- $this->setOwner($owner);
- $this->setGrants($grants);
- }
-
- /**
- * Create an Acp object from an array. This can be used to create an ACP from a response to a GetObject/Bucket ACL
- * operation.
- *
- * @param array $data Array of ACP data
- *
- * @return Acp
- */
- public static function fromArray(array $data)
- {
- $builder = new AcpBuilder();
- $builder->setOwner((string) $data['Owner']['ID'], $data['Owner']['DisplayName']);
-
- // Add each Grantee to the ACP
- foreach ($data['Grants'] as $grant) {
- $permission = $grant['Permission'];
-
- // Determine the type for response bodies that are missing the Type parameter
- if (!isset($grant['Grantee']['Type'])) {
- if (isset($grant['Grantee']['ID'])) {
- $grant['Grantee']['Type'] = 'CanonicalUser';
- } elseif (isset($grant['Grantee']['URI'])) {
- $grant['Grantee']['Type'] = 'Group';
- } else {
- $grant['Grantee']['Type'] = 'AmazonCustomerByEmail';
- }
- }
-
- switch ($grant['Grantee']['Type']) {
- case 'Group':
- $builder->addGrantForGroup($permission, $grant['Grantee']['URI']);
- break;
- case 'AmazonCustomerByEmail':
- $builder->addGrantForEmail($permission, $grant['Grantee']['EmailAddress']);
- break;
- case 'CanonicalUser':
- $builder->addGrantForUser(
- $permission,
- $grant['Grantee']['ID'],
- $grant['Grantee']['DisplayName']
- );
- }
- }
-
- return $builder->build();
- }
-
- /**
- * Set the owner of the ACP policy
- *
- * @param Grantee $owner ACP policy owner
- *
- * @return $this
- *
- * @throws InvalidArgumentException if the grantee does not have an ID set
- */
- public function setOwner(Grantee $owner)
- {
- if (!$owner->isCanonicalUser()) {
- throw new InvalidArgumentException('The owner must have an ID set.');
- }
-
- $this->owner = $owner;
-
- return $this;
- }
-
- /**
- * Get the owner of the ACP policy
- *
- * @return Grantee
- */
- public function getOwner()
- {
- return $this->owner;
- }
-
- /**
- * Set the grants for the ACP
- *
- * @param array|\Traversable $grants List of grants for the ACP
- *
- * @return $this
- *
- * @throws InvalidArgumentException
- */
- public function setGrants($grants = array())
- {
- $this->grants = new \SplObjectStorage();
-
- if ($grants) {
- if (is_array($grants) || $grants instanceof \Traversable) {
- /** @var $grant Grant */
- foreach ($grants as $grant) {
- $this->addGrant($grant);
- }
- } else {
- throw new InvalidArgumentException('Grants must be passed in as an array or Traversable object.');
- }
- }
-
- return $this;
- }
-
- /**
- * Get all of the grants
- *
- * @return \SplObjectStorage
- */
- public function getGrants()
- {
- return $this->grants;
- }
-
- /**
- * Add a Grant
- *
- * @param Grant $grant Grant to add
- *
- * @return $this
- */
- public function addGrant(Grant $grant)
- {
- if (count($this->grants) < 100) {
- $this->grants->attach($grant);
- } else {
- throw new OverflowException('An ACP may contain up to 100 grants.');
- }
-
- return $this;
- }
-
- /**
- * Get the total number of attributes
- *
- * @return int
- */
- public function count()
- {
- return count($this->grants);
- }
-
- /**
- * Returns the grants for iteration
- *
- * @return \SplObjectStorage
- */
- public function getIterator()
- {
- return $this->grants;
- }
-
- /**
- * Applies grant headers to a command's parameters
- *
- * @param AbstractCommand $command Command to be updated
- *
- * @return $this
- */
- public function updateCommand(AbstractCommand $command)
- {
- $parameters = array();
- foreach ($this->grants as $grant) {
- /** @var $grant Grant */
- $parameters = array_merge_recursive($parameters, $grant->getParameterArray());
- }
-
- foreach ($parameters as $name => $values) {
- $command->set($name, implode(', ', (array) $values));
- }
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function toArray()
- {
- $grants = array();
- foreach ($this->grants as $grant) {
- $grants[] = $grant->toArray();
- }
-
- return array(
- 'Owner' => array(
- 'ID' => $this->owner->getId(),
- 'DisplayName' => $this->owner->getDisplayName()
- ),
- 'Grants' => $grants
- );
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/AcpBuilder.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/AcpBuilder.php
deleted file mode 100644
index b6d1be72167..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/AcpBuilder.php
+++ /dev/null
@@ -1,134 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model;
-
-use Aws\S3\Enum\GranteeType;
-
-/**
- * Builder for creating Access Control Policies
- */
-class AcpBuilder
-{
- /**
- * @var Grantee The owner for the ACL
- */
- protected $owner;
-
- /**
- * @var array An array of Grant objects for the ACL
- */
- protected $grants = array();
-
- /**
- * Static method for chainable instantiation
- *
- * @return static
- */
- public static function newInstance()
- {
- return new static;
- }
-
- /**
- * Sets the owner to be set on the ACL
- *
- * @param string $id Owner identifier
- * @param string $displayName Owner display name
- *
- * @return $this
- */
- public function setOwner($id, $displayName = null)
- {
- $this->owner = new Grantee($id, $displayName ?: $id, GranteeType::USER);
-
- return $this;
- }
-
- /**
- * Create and store a Grant with a CanonicalUser Grantee for the ACL
- *
- * @param string $permission Permission for the Grant
- * @param string $id Grantee identifier
- * @param string $displayName Grantee display name
- *
- * @return $this
- */
- public function addGrantForUser($permission, $id, $displayName = null)
- {
- $grantee = new Grantee($id, $displayName ?: $id, GranteeType::USER);
- $this->addGrant($permission, $grantee);
-
- return $this;
- }
-
- /**
- * Create and store a Grant with a AmazonCustomerByEmail Grantee for the ACL
- *
- * @param string $permission Permission for the Grant
- * @param string $email Grantee email address
- *
- * @return $this
- */
- public function addGrantForEmail($permission, $email)
- {
- $grantee = new Grantee($email, null, GranteeType::EMAIL);
- $this->addGrant($permission, $grantee);
-
- return $this;
- }
-
- /**
- * Create and store a Grant with a Group Grantee for the ACL
- *
- * @param string $permission Permission for the Grant
- * @param string $group Grantee group
- *
- * @return $this
- */
- public function addGrantForGroup($permission, $group)
- {
- $grantee = new Grantee($group, null, GranteeType::GROUP);
- $this->addGrant($permission, $grantee);
-
- return $this;
- }
-
- /**
- * Create and store a Grant for the ACL
- *
- * @param string $permission Permission for the Grant
- * @param Grantee $grantee The Grantee for the Grant
- *
- * @return $this
- */
- public function addGrant($permission, Grantee $grantee)
- {
- $this->grants[] = new Grant($grantee, $permission);
-
- return $this;
- }
-
- /**
- * Builds the ACP and returns it
- *
- * @return Acp
- */
- public function build()
- {
- return new Acp($this->owner, $this->grants);
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/ClearBucket.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/ClearBucket.php
deleted file mode 100644
index 09982d8ae7d..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/ClearBucket.php
+++ /dev/null
@@ -1,189 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model;
-
-use Aws\Common\Client\AwsClientInterface;
-use Guzzle\Common\AbstractHasDispatcher;
-use Guzzle\Batch\FlushingBatch;
-use Guzzle\Batch\ExceptionBufferingBatch;
-use Guzzle\Batch\NotifyingBatch;
-use Guzzle\Common\Exception\ExceptionCollection;
-
-/**
- * Class used to clear the contents of a bucket or the results of an iterator
- */
-class ClearBucket extends AbstractHasDispatcher
-{
- /**
- * @var string Event emitted when a batch request has completed
- */
- const AFTER_DELETE = 'clear_bucket.after_delete';
-
- /**
- * @var string Event emitted before the bucket is cleared
- */
- const BEFORE_CLEAR = 'clear_bucket.before_clear';
-
- /**
- * @var string Event emitted after the bucket is cleared
- */
- const AFTER_CLEAR = 'clear_bucket.after_clear';
-
- /**
- * @var AwsClientInterface Client used to execute the requests
- */
- protected $client;
-
- /**
- * @var AbstractS3ResourceIterator Iterator used to yield keys
- */
- protected $iterator;
-
- /**
- * @var string MFA used with each request
- */
- protected $mfa;
-
- /**
- * @param AwsClientInterface $client Client used to execute requests
- * @param string $bucket Name of the bucket to clear
- */
- public function __construct(AwsClientInterface $client, $bucket)
- {
- $this->client = $client;
- $this->bucket = $bucket;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getAllEvents()
- {
- return array(self::AFTER_DELETE, self::BEFORE_CLEAR, self::AFTER_CLEAR);
- }
-
- /**
- * Set the bucket that is to be cleared
- *
- * @param string $bucket Name of the bucket to clear
- *
- * @return $this
- */
- public function setBucket($bucket)
- {
- $this->bucket = $bucket;
-
- return $this;
- }
-
- /**
- * Get the iterator used to yield the keys to be deleted. A default iterator
- * will be created and returned if no iterator has been explicitly set.
- *
- * @return \Iterator
- */
- public function getIterator()
- {
- if (!$this->iterator) {
- $this->iterator = $this->client->getIterator('ListObjectVersions', array(
- 'Bucket' => $this->bucket
- ));
- }
-
- return $this->iterator;
- }
-
- /**
- * Sets a different iterator to use than the default iterator. This can be helpful when you wish to delete
- * only specific keys from a bucket (e.g. keys that match a certain prefix or delimiter, or perhaps keys that
- * pass through a filtered, decorated iterator).
- *
- * @param \Iterator $iterator Iterator used to yield the keys to be deleted
- *
- * @return $this
- */
- public function setIterator(\Iterator $iterator)
- {
- $this->iterator = $iterator;
-
- return $this;
- }
-
- /**
- * Set the MFA token to send with each request
- *
- * @param string $mfa MFA token to send with each request. The value is the concatenation of the authentication
- * device's serial number, a space, and the value displayed on your authentication device.
- *
- * @return $this
- */
- public function setMfa($mfa)
- {
- $this->mfa = $mfa;
-
- return $this;
- }
-
- /**
- * Clear the bucket
- *
- * @return int Returns the number of deleted keys
- * @throws ExceptionCollection
- */
- public function clear()
- {
- $that = $this;
- $batch = DeleteObjectsBatch::factory($this->client, $this->bucket, $this->mfa);
- $batch = new NotifyingBatch($batch, function ($items) use ($that) {
- $that->dispatch(ClearBucket::AFTER_DELETE, array('keys' => $items));
- });
- $batch = new FlushingBatch(new ExceptionBufferingBatch($batch), 1000);
-
- // Let any listeners know that the bucket is about to be cleared
- $this->dispatch(self::BEFORE_CLEAR, array(
- 'iterator' => $this->getIterator(),
- 'batch' => $batch,
- 'mfa' => $this->mfa
- ));
-
- $deleted = 0;
- foreach ($this->getIterator() as $object) {
- if (isset($object['VersionId'])) {
- $versionId = $object['VersionId'] == 'null' ? null : $object['VersionId'];
- } else {
- $versionId = null;
- }
- $batch->addKey($object['Key'], $versionId);
- $deleted++;
- }
- $batch->flush();
-
- // If any errors were encountered, then throw an ExceptionCollection
- if (count($batch->getExceptions())) {
- $e = new ExceptionCollection();
- foreach ($batch->getExceptions() as $exception) {
- $e->add($exception->getPrevious());
- }
- throw $e;
- }
-
- // Let any listeners know that the bucket was cleared
- $this->dispatch(self::AFTER_CLEAR, array('deleted' => $deleted));
-
- return $deleted;
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/DeleteObjectsBatch.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/DeleteObjectsBatch.php
deleted file mode 100644
index ab6425bbb87..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/DeleteObjectsBatch.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model;
-
-use Aws\Common\Client\AwsClientInterface;
-use Aws\Common\Exception\InvalidArgumentException;
-use Guzzle\Service\Command\AbstractCommand;
-use Guzzle\Batch\BatchBuilder;
-use Guzzle\Batch\BatchSizeDivisor;
-use Guzzle\Batch\AbstractBatchDecorator;
-
-/**
- * The DeleteObjectsBatch is a BatchDecorator for Guzzle that implements a
- * queue for deleting keys from an Amazon S3 bucket. You can add DeleteObject
- * or an array of [Key => %s, VersionId => %s] and call flush when the objects
- * should be deleted.
- */
-class DeleteObjectsBatch extends AbstractBatchDecorator
-{
- /**
- * Factory for creating a DeleteObjectsBatch
- *
- * @param AwsClientInterface $client Client used to transfer requests
- * @param string $bucket Bucket that contains the objects to delete
- * @param string $mfa MFA token to use with the request
- *
- * @return static
- */
- public static function factory(AwsClientInterface $client, $bucket, $mfa = null)
- {
- $batch = BatchBuilder::factory()
- ->createBatchesWith(new BatchSizeDivisor(1000))
- ->transferWith(new DeleteObjectsTransfer($client, $bucket, $mfa))
- ->build();
-
- return new static($batch);
- }
-
- /**
- * Add an object to be deleted
- *
- * @param string $key Key of the object
- * @param string $versionId VersionID of the object
- *
- * @return $this
- */
- public function addKey($key, $versionId = null)
- {
- return $this->add(array(
- 'Key' => $key,
- 'VersionId' => $versionId
- ));
- }
-
- /**
- * {@inheritdoc}
- */
- public function add($item)
- {
- if ($item instanceof AbstractCommand && $item->getName() == 'DeleteObject') {
- $item = array(
- 'Key' => $item['Key'],
- 'VersionId' => $item['VersionId']
- );
- }
-
- if (!is_array($item) || (!isset($item['Key']))) {
- throw new InvalidArgumentException('Item must be a DeleteObject command or array containing a Key and VersionId key.');
- }
-
- return parent::add($item);
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/DeleteObjectsTransfer.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/DeleteObjectsTransfer.php
deleted file mode 100644
index 5918ff18ff7..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/DeleteObjectsTransfer.php
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model;
-
-use Aws\Common\Client\AwsClientInterface;
-use Aws\Common\Exception\OverflowException;
-use Aws\Common\Enum\UaString as Ua;
-use Aws\S3\Exception\InvalidArgumentException;
-use Aws\S3\Exception\DeleteMultipleObjectsException;
-use Guzzle\Batch\BatchTransferInterface;
-use Guzzle\Service\Command\CommandInterface;
-
-/**
- * Transfer logic for deleting multiple objects from an Amazon S3 bucket in a
- * single request
- */
-class DeleteObjectsTransfer implements BatchTransferInterface
-{
- /**
- * @var AwsClientInterface The Amazon S3 client for doing transfers
- */
- protected $client;
-
- /**
- * @var string Bucket from which to delete the objects
- */
- protected $bucket;
-
- /**
- * @var string MFA token to apply to the request
- */
- protected $mfa;
-
- /**
- * Constructs a transfer using the injected client
- *
- * @param AwsClientInterface $client Client used to transfer the requests
- * @param string $bucket Name of the bucket that stores the objects
- * @param string $mfa MFA token used when contacting the Amazon S3 API
- */
- public function __construct(AwsClientInterface $client, $bucket, $mfa = null)
- {
- $this->client = $client;
- $this->bucket = $bucket;
- $this->mfa = $mfa;
- }
-
- /**
- * Set a new MFA token value
- *
- * @param string $token MFA token
- *
- * @return $this
- */
- public function setMfa($token)
- {
- $this->mfa = $token;
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- * @throws OverflowException if a batch has more than 1000 items
- * @throws InvalidArgumentException when an invalid batch item is encountered
- */
- public function transfer(array $batch)
- {
- if (empty($batch)) {
- return;
- }
-
- if (count($batch) > 1000) {
- throw new OverflowException('Batches should be divided into chunks of no larger than 1000 keys');
- }
-
- $del = array();
- $command = $this->client->getCommand('DeleteObjects', array(
- 'Bucket' => $this->bucket,
- Ua::OPTION => Ua::BATCH
- ));
-
- if ($this->mfa) {
- $command->getRequestHeaders()->set('x-amz-mfa', $this->mfa);
- }
-
- foreach ($batch as $object) {
- // Ensure that the batch item is valid
- if (!is_array($object) || !isset($object['Key'])) {
- throw new InvalidArgumentException('Invalid batch item encountered: ' . var_export($batch, true));
- }
- $del[] = array(
- 'Key' => $object['Key'],
- 'VersionId' => isset($object['VersionId']) ? $object['VersionId'] : null
- );
- }
-
- $command['Objects'] = $del;
-
- $command->execute();
- $this->processResponse($command);
- }
-
- /**
- * Process the response of the DeleteMultipleObjects request
- *
- * @paramCommandInterface $command Command executed
- */
- protected function processResponse(CommandInterface $command)
- {
- $result = $command->getResult();
-
- // Ensure that the objects were deleted successfully
- if (!empty($result['Errors'])) {
- $errors = $result['Errors'];
- throw new DeleteMultipleObjectsException($errors);
- }
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Grant.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Grant.php
deleted file mode 100644
index 2e35f059511..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Grant.php
+++ /dev/null
@@ -1,139 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model;
-
-use Aws\S3\Enum\Permission;
-use Aws\Common\Exception\InvalidArgumentException;
-use Guzzle\Common\ToArrayInterface;
-
-/**
- * Amazon S3 Grant model
- */
-class Grant implements ToArrayInterface
-{
- /**
- * @var array A map of permissions to operation parameters
- */
- protected static $parameterMap = array(
- Permission::READ => 'GrantRead',
- Permission::WRITE => 'GrantWrite',
- Permission::READ_ACP => 'GrantReadACP',
- Permission::WRITE_ACP => 'GrantWriteACP',
- Permission::FULL_CONTROL => 'GrantFullControl'
- );
-
- /**
- * @var Grantee The grantee affected by the grant
- */
- protected $grantee;
-
- /**
- * @var string The permission set by the grant
- */
- protected $permission;
-
- /**
- * Constructs an ACL
- *
- * @param Grantee $grantee Affected grantee
- * @param string $permission Permission applied
- */
- public function __construct(Grantee $grantee, $permission)
- {
- $this->setGrantee($grantee);
- $this->setPermission($permission);
- }
-
- /**
- * Set the grantee affected by the grant
- *
- * @param Grantee $grantee Affected grantee
- *
- * @return $this
- */
- public function setGrantee(Grantee $grantee)
- {
- $this->grantee = $grantee;
-
- return $this;
- }
-
- /**
- * Get the grantee affected by the grant
- *
- * @return Grantee
- */
- public function getGrantee()
- {
- return $this->grantee;
- }
-
- /**
- * Set the permission set by the grant
- *
- * @param string $permission Permission applied
- *
- * @return $this
- *
- * @throws InvalidArgumentException
- */
- public function setPermission($permission)
- {
- $valid = Permission::values();
- if (!in_array($permission, $valid)) {
- throw new InvalidArgumentException('The permission must be one of '
- . 'the following: ' . implode(', ', $valid) . '.');
- }
-
- $this->permission = $permission;
-
- return $this;
- }
-
- /**
- * Get the permission set by the grant
- *
- * @return string
- */
- public function getPermission()
- {
- return $this->permission;
- }
-
- /**
- * Returns an array of the operation parameter and value to set on the operation
- *
- * @return array
- */
- public function getParameterArray()
- {
- return array(
- self::$parameterMap[$this->permission] => $this->grantee->getHeaderValue()
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function toArray()
- {
- return array(
- 'Grantee' => $this->grantee->toArray(),
- 'Permission' => $this->permission
- );
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Grantee.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Grantee.php
deleted file mode 100644
index 7634b84a350..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/Grantee.php
+++ /dev/null
@@ -1,245 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model;
-
-use Aws\S3\Enum\Group;
-use Aws\S3\Enum\GranteeType;
-use Aws\Common\Exception\InvalidArgumentException;
-use Aws\Common\Exception\UnexpectedValueException;
-use Aws\Common\Exception\LogicException;
-use Guzzle\Common\ToArrayInterface;
-
-/**
- * Amazon S3 Grantee model
- */
-class Grantee implements ToArrayInterface
-{
- /**
- * @var array A map of grantee types to grant header value prefixes
- */
- protected static $headerMap = array(
- GranteeType::USER => 'id',
- GranteeType::EMAIL => 'emailAddress',
- GranteeType::GROUP => 'uri'
- );
-
- /**
- * @var string The account ID, email, or URL identifying the grantee
- */
- protected $id;
-
- /**
- * @var string The display name of the grantee
- */
- protected $displayName;
-
- /**
- * @var string The type of the grantee (CanonicalUser or Group)
- */
- protected $type;
-
- /**
- * Constructs a Grantee
- *
- * @param string $id Grantee identifier
- * @param string $displayName Grantee display name
- * @param string $expectedType The expected type of the grantee
- */
- public function __construct($id, $displayName = null, $expectedType = null)
- {
- $this->type = GranteeType::USER;
- $this->setId($id, $expectedType);
- $this->setDisplayName($displayName);
- }
-
- /**
- * Sets the account ID, email, or URL identifying the grantee
- *
- * @param string $id Grantee identifier
- * @param string $expectedType The expected type of the grantee
- *
- * @return Grantee
- *
- * @throws UnexpectedValueException if $expectedType is set and the grantee
- * is not of that type after instantiation
- * @throws InvalidArgumentException when the ID provided is not a string
- */
- public function setId($id, $expectedType = null)
- {
- if (in_array($id, Group::values())) {
- $this->type = GranteeType::GROUP;
- } elseif (!is_string($id)) {
- throw new InvalidArgumentException('The grantee ID must be provided as a string value.');
- }
-
- if (strpos($id, '@') !== false) {
- $this->type = GranteeType::EMAIL;
- }
-
- if ($expectedType && $expectedType !== $this->type) {
- throw new UnexpectedValueException('The type of the grantee after '
- . 'setting the ID did not match the specified, expected type "'
- . $expectedType . '" but received "' . $this->type . '".');
- }
-
- $this->id = $id;
-
- return $this;
- }
-
- /**
- * Gets the grantee identifier
- *
- * @return string
- */
- public function getId()
- {
- return $this->id;
- }
-
- /**
- * Gets the grantee email address (if it is set)
- *
- * @return null|string
- */
- public function getEmailAddress()
- {
- return $this->isAmazonCustomerByEmail() ? $this->id : null;
- }
-
- /**
- * Gets the grantee URI (if it is set)
- *
- * @return null|string
- */
- public function getGroupUri()
- {
- return $this->isGroup() ? $this->id : null;
- }
-
- /**
- * Sets the display name of the grantee
- *
- * @param string $displayName Grantee name
- *
- * @return Grantee
- *
- * @throws LogicException when the grantee type not CanonicalUser
- */
- public function setDisplayName($displayName)
- {
- if ($this->type === GranteeType::USER) {
- if (empty($displayName) || !is_string($displayName)) {
- $displayName = $this->id;
- }
- $this->displayName = $displayName;
- } else {
- if ($displayName) {
- throw new LogicException('The display name can only be set '
- . 'for grantees specified by ID.');
- }
- }
-
- return $this;
- }
-
- /**
- * Gets the grantee display name
- *
- * @return string
- */
- public function getDisplayName()
- {
- return $this->displayName;
- }
-
- /**
- * Gets the grantee type (determined by ID)
- *
- * @return string
- */
- public function getType()
- {
- return $this->type;
- }
-
- /**
- * Returns true if this grantee object represents a canonical user by ID
- *
- * @return bool
- */
- public function isCanonicalUser()
- {
- return ($this->type === GranteeType::USER);
- }
-
- /**
- * Returns true if this grantee object represents a customer by email
- *
- * @return bool
- */
- public function isAmazonCustomerByEmail()
- {
- return ($this->type === GranteeType::EMAIL);
- }
-
- /**
- * Returns true if this grantee object represents a group by URL
- *
- * @return bool
- */
- public function isGroup()
- {
- return ($this->type === GranteeType::GROUP);
- }
-
- /**
- * Returns the value used in headers to specify this grantee
- *
- * @return string
- */
- public function getHeaderValue()
- {
- $key = static::$headerMap[$this->type];
-
- return "{$key}=\"{$this->id}\"";
- }
-
- /**
- * {@inheritdoc}
- */
- public function toArray()
- {
- $result = array(
- 'Type' => $this->type
- );
-
- switch ($this->type) {
- case GranteeType::USER:
- $result['ID'] = $this->id;
- $result['DisplayName'] = $this->displayName;
- break;
- case GranteeType::EMAIL:
- $result['EmailAddress'] = $this->id;
- break;
- case GranteeType::GROUP:
- $result['URI'] = $this->id;
- }
-
- return $result;
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/AbstractTransfer.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/AbstractTransfer.php
deleted file mode 100644
index c48232d492f..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/AbstractTransfer.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model\MultipartUpload;
-
-use Aws\Common\Enum\UaString as Ua;
-use Aws\Common\Exception\RuntimeException;
-use Aws\Common\Model\MultipartUpload\AbstractTransfer as CommonAbstractTransfer;
-use Guzzle\Service\Command\OperationCommand;
-
-/**
- * Abstract class for transfer commonalities
- */
-abstract class AbstractTransfer extends CommonAbstractTransfer
-{
- // An S3 upload part can be anywhere from 5 MB to 5 GB, but you can only have 10000 parts per upload
- const MIN_PART_SIZE = 5242880;
- const MAX_PART_SIZE = 5368709120;
- const MAX_PARTS = 10000;
-
- /**
- * {@inheritdoc}
- * @throws RuntimeException if the part size can not be calculated from the provided data
- */
- protected function init()
- {
- // Merge provided options onto the default option values
- $this->options = array_replace(array(
- 'min_part_size' => self::MIN_PART_SIZE,
- 'part_md5' => true
- ), $this->options);
-
- // Make sure the part size can be calculated somehow
- if (!$this->options['min_part_size'] && !$this->source->getContentLength()) {
- throw new RuntimeException('The ContentLength of the data source could not be determined, and no '
- . 'min_part_size option was provided');
- }
- }
-
- /**
- * {@inheritdoc}
- */
- protected function calculatePartSize()
- {
- $partSize = $this->source->getContentLength()
- ? (int) ceil(($this->source->getContentLength() / self::MAX_PARTS))
- : self::MIN_PART_SIZE;
- $partSize = max($this->options['min_part_size'], $partSize);
- $partSize = min($partSize, self::MAX_PART_SIZE);
- $partSize = max($partSize, self::MIN_PART_SIZE);
-
- return $partSize;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function complete()
- {
- /** @var $part UploadPart */
- $parts = array();
- foreach ($this->state as $part) {
- $parts[] = array(
- 'PartNumber' => $part->getPartNumber(),
- 'ETag' => $part->getETag(),
- );
- }
-
- $params = $this->state->getUploadId()->toParams();
- $params[Ua::OPTION] = Ua::MULTIPART_UPLOAD;
- $params['Parts'] = $parts;
- $command = $this->client->getCommand('CompleteMultipartUpload', $params);
-
- return $command->getResult();
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getAbortCommand()
- {
- $params = $this->state->getUploadId()->toParams();
- $params[Ua::OPTION] = Ua::MULTIPART_UPLOAD;
-
- /** @var $command OperationCommand */
- $command = $this->client->getCommand('AbortMultipartUpload', $params);
-
- return $command;
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/ParallelTransfer.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/ParallelTransfer.php
deleted file mode 100644
index caa9e888331..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/ParallelTransfer.php
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model\MultipartUpload;
-
-use Aws\Common\Exception\RuntimeException;
-use Aws\Common\Enum\DateFormat;
-use Aws\Common\Enum\UaString as Ua;
-use Guzzle\Http\EntityBody;
-use Guzzle\Http\ReadLimitEntityBody;
-
-/**
- * Transfers multipart upload parts in parallel
- */
-class ParallelTransfer extends AbstractTransfer
-{
- /**
- * {@inheritdoc}
- */
- protected function init()
- {
- parent::init();
-
- if (!$this->source->isLocal() || $this->source->getWrapper() != 'plainfile') {
- throw new RuntimeException('The source data must be a local file stream when uploading in parallel.');
- }
-
- if (empty($this->options['concurrency'])) {
- throw new RuntimeException('The `concurrency` option must be specified when instantiating.');
- }
- }
-
- /**
- * {@inheritdoc}
- */
- protected function transfer()
- {
- $totalParts = (int) ceil($this->source->getContentLength() / $this->partSize);
- $concurrency = min($totalParts, $this->options['concurrency']);
- $partsToSend = $this->prepareParts($concurrency);
- $eventData = $this->getEventData();
-
- while (!$this->stopped && count($this->state) < $totalParts) {
-
- $currentTotal = count($this->state);
- $commands = array();
-
- for ($i = 0; $i < $concurrency && $i + $currentTotal < $totalParts; $i++) {
-
- // Move the offset to the correct position
- $partsToSend[$i]->setOffset(($currentTotal + $i) * $this->partSize);
-
- // @codeCoverageIgnoreStart
- if ($partsToSend[$i]->getContentLength() == 0) {
- break;
- }
- // @codeCoverageIgnoreEnd
-
- $params = $this->state->getUploadId()->toParams();
- $eventData['command'] = $this->client->getCommand('UploadPart', array_replace($params, array(
- 'PartNumber' => count($this->state) + 1 + $i,
- 'Body' => $partsToSend[$i],
- 'ContentMD5' => (bool) $this->options['part_md5'],
- Ua::OPTION => Ua::MULTIPART_UPLOAD
- )));
- $commands[] = $eventData['command'];
- // Notify any listeners of the part upload
- $this->dispatch(self::BEFORE_PART_UPLOAD, $eventData);
- }
-
- // Allow listeners to stop the transfer if needed
- if ($this->stopped) {
- break;
- }
-
- // Execute each command, iterate over the results, and add to the transfer state
- /** @var $command \Guzzle\Service\Command\OperationCommand */
- foreach ($this->client->execute($commands) as $command) {
- $this->state->addPart(UploadPart::fromArray(array(
- 'PartNumber' => count($this->state) + 1,
- 'ETag' => $command->getResponse()->getEtag(),
- 'Size' => (int) $command->getResponse()->getContentLength(),
- 'LastModified' => gmdate(DateFormat::RFC2822)
- )));
- $eventData['command'] = $command;
- // Notify any listeners the the part was uploaded
- $this->dispatch(self::AFTER_PART_UPLOAD, $eventData);
- }
- }
- }
-
- /**
- * Prepare the entity body handles to use while transferring
- *
- * @param int $concurrency Number of parts to prepare
- *
- * @return array Parts to send
- */
- protected function prepareParts($concurrency)
- {
- $url = $this->source->getUri();
- // Use the source EntityBody as the first part
- $parts = array(new ReadLimitEntityBody($this->source, $this->partSize));
- // Open EntityBody handles for each part to upload in parallel
- for ($i = 1; $i < $concurrency; $i++) {
- $parts[] = new ReadLimitEntityBody(new EntityBody(fopen($url, 'r')), $this->partSize);
- }
-
- return $parts;
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/SerialTransfer.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/SerialTransfer.php
deleted file mode 100644
index 4a5953f5b24..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/SerialTransfer.php
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model\MultipartUpload;
-
-use Aws\Common\Enum\DateFormat;
-use Aws\Common\Enum\Size;
-use Aws\Common\Enum\UaString as Ua;
-use Guzzle\Http\EntityBody;
-use Guzzle\Http\ReadLimitEntityBody;
-
-/**
- * Transfers multipart upload parts serially
- */
-class SerialTransfer extends AbstractTransfer
-{
- /**
- * {@inheritdoc}
- */
- protected function transfer()
- {
- while (!$this->stopped && !$this->source->isConsumed()) {
-
- if ($this->source->getContentLength() && $this->source->isSeekable()) {
- // If the stream is seekable and the Content-Length known, then stream from the data source
- $body = new ReadLimitEntityBody($this->source, $this->partSize, $this->source->ftell());
- } else {
- // We need to read the data source into a temporary buffer before streaming
- $body = EntityBody::factory();
- while ($body->getContentLength() < $this->partSize
- && $body->write(
- $this->source->read(max(1, min(10 * Size::KB, $this->partSize - $body->getContentLength())))
- ));
- }
-
- // @codeCoverageIgnoreStart
- if ($body->getContentLength() == 0) {
- break;
- }
- // @codeCoverageIgnoreEnd
-
- $params = $this->state->getUploadId()->toParams();
- $command = $this->client->getCommand('UploadPart', array_replace($params, array(
- 'PartNumber' => count($this->state) + 1,
- 'Body' => $body,
- 'ContentMD5' => (bool) $this->options['part_md5'],
- Ua::OPTION => Ua::MULTIPART_UPLOAD
- )));
-
- // Notify observers that the part is about to be uploaded
- $eventData = $this->getEventData();
- $eventData['command'] = $command;
- $this->dispatch(self::BEFORE_PART_UPLOAD, $eventData);
-
- // Allow listeners to stop the transfer if needed
- if ($this->stopped) {
- break;
- }
-
- $response = $command->getResponse();
-
- $this->state->addPart(UploadPart::fromArray(array(
- 'PartNumber' => count($this->state) + 1,
- 'ETag' => $response->getEtag(),
- 'Size' => $body->getContentLength(),
- 'LastModified' => gmdate(DateFormat::RFC2822)
- )));
-
- // Notify observers that the part was uploaded
- $this->dispatch(self::AFTER_PART_UPLOAD, $eventData);
- }
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/TransferState.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/TransferState.php
deleted file mode 100644
index c63663fd648..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/TransferState.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model\MultipartUpload;
-
-use Aws\Common\Client\AwsClientInterface;
-use Aws\Common\Model\MultipartUpload\AbstractTransferState;
-use Aws\Common\Model\MultipartUpload\UploadIdInterface;
-
-/**
- * State of a multipart upload
- */
-class TransferState extends AbstractTransferState
-{
- /**
- * {@inheritdoc}
- */
- public static function fromUploadId(AwsClientInterface $client, UploadIdInterface $uploadId)
- {
- $transferState = new self($uploadId);
-
- foreach ($client->getIterator('ListParts', $uploadId->toParams()) as $part) {
- $transferState->addPart(UploadPart::fromArray($part));
- }
-
- return $transferState;
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadBuilder.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadBuilder.php
deleted file mode 100644
index e30f23a36cf..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadBuilder.php
+++ /dev/null
@@ -1,297 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model\MultipartUpload;
-
-use Aws\Common\Enum\UaString as Ua;
-use Aws\Common\Exception\InvalidArgumentException;
-use Aws\Common\Model\MultipartUpload\AbstractUploadBuilder;
-use Aws\S3\Model\Acp;
-
-/**
- * Easily create a multipart uploader used to quickly and reliably upload a
- * large file or data stream to Amazon S3 using multipart uploads
- */
-class UploadBuilder extends AbstractUploadBuilder
-{
- /**
- * @var int Concurrency level to transfer the parts
- */
- protected $concurrency = 1;
-
- /**
- * @var int Minimum part size to upload
- */
- protected $minPartSize = AbstractTransfer::MIN_PART_SIZE;
-
- /**
- * @var string MD5 hash of the entire body to transfer
- */
- protected $md5;
-
- /**
- * @var bool Whether or not to calculate the entire MD5 hash of the object
- */
- protected $calculateEntireMd5 = false;
-
- /**
- * @var bool Whether or not to calculate MD5 hash of each part
- */
- protected $calculatePartMd5 = true;
-
- /**
- * @var array Array of initiate command options
- */
- protected $commandOptions = array();
-
- /**
- * @var array Array of transfer options
- */
- protected $transferOptions = array();
-
- /**
- * Set the bucket to upload the object to
- *
- * @param string $bucket Name of the bucket
- *
- * @return $this
- */
- public function setBucket($bucket)
- {
- return $this->setOption('Bucket', $bucket);
- }
-
- /**
- * Set the key of the object
- *
- * @param string $key Key of the object to upload
- *
- * @return $this
- */
- public function setKey($key)
- {
- return $this->setOption('Key', $key);
- }
-
- /**
- * Set the minimum acceptable part size
- *
- * @param int $minSize Minimum acceptable part size in bytes
- *
- * @return $this
- */
- public function setMinPartSize($minSize)
- {
- $this->minPartSize = (int) max((int) $minSize, AbstractTransfer::MIN_PART_SIZE);
-
- return $this;
- }
-
- /**
- * Set the concurrency level to use when uploading parts. This affects how
- * many parts are uploaded in parallel. You must use a local file as your
- * data source when using a concurrency greater than 1
- *
- * @param int $concurrency Concurrency level
- *
- * @return $this
- */
- public function setConcurrency($concurrency)
- {
- $this->concurrency = $concurrency;
-
- return $this;
- }
-
- /**
- * Explicitly set the MD5 hash of the entire body
- *
- * @param string $md5 MD5 hash of the entire body
- *
- * @return $this
- */
- public function setMd5($md5)
- {
- $this->md5 = $md5;
-
- return $this;
- }
-
- /**
- * Set to true to have the builder calculate the MD5 hash of the entire data
- * source before initiating a multipart upload (this could be an expensive
- * operation). This setting can ony be used with seekable data sources.
- *
- * @param bool $calculateMd5 Set to true to calculate the MD5 hash of the body
- *
- * @return $this
- */
- public function calculateMd5($calculateMd5)
- {
- $this->calculateEntireMd5 = (bool) $calculateMd5;
-
- return $this;
- }
-
- /**
- * Specify whether or not to calculate the MD5 hash of each uploaded part.
- * This setting defaults to true.
- *
- * @param bool $usePartMd5 Set to true to calculate the MD5 has of each part
- *
- * @return $this
- */
- public function calculatePartMd5($usePartMd5)
- {
- $this->calculatePartMd5 = (bool) $usePartMd5;
-
- return $this;
- }
-
- /**
- * Set the ACP to use on the object
- *
- * @param Acp $acp ACP to set on the object
- *
- * @return $this
- */
- public function setAcp(Acp $acp)
- {
- return $this->setOption('ACP', $acp);
- }
-
- /**
- * Set an option to pass to the initial CreateMultipartUpload operation
- *
- * @param string $name Option name
- * @param string $value Option value
- *
- * @return $this
- */
- public function setOption($name, $value)
- {
- $this->commandOptions[$name] = $value;
-
- return $this;
- }
-
- /**
- * Add an array of options to pass to the initial CreateMultipartUpload operation
- *
- * @param array $options Array of CreateMultipartUpload operation parameters
- *
- * @return $this
- */
- public function addOptions(array $options)
- {
- $this->commandOptions = array_replace($this->commandOptions, $options);
-
- return $this;
- }
-
- /**
- * Set an array of transfer options to apply to the upload transfer object
- *
- * @param array $options Transfer options
- *
- * @return $this
- */
- public function setTransferOptions(array $options)
- {
- $this->transferOptions = $options;
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- * @throws InvalidArgumentException when attempting to resume a transfer using a non-seekable stream
- * @throws InvalidArgumentException when missing required properties (bucket, key, client, source)
- */
- public function build()
- {
- if ($this->state instanceof TransferState) {
- $this->commandOptions = array_replace($this->commandOptions, $this->state->getUploadId()->toParams());
- }
-
- if (!isset($this->commandOptions['Bucket']) || !isset($this->commandOptions['Key'])
- || !$this->client || !$this->source
- ) {
- throw new InvalidArgumentException('You must specify a Bucket, Key, client, and source.');
- }
-
- if ($this->state && !$this->source->isSeekable()) {
- throw new InvalidArgumentException('You cannot resume a transfer using a non-seekable source.');
- }
-
- // If no state was set, then create one by initiating or loading a multipart upload
- if (is_string($this->state)) {
- $this->state = TransferState::fromUploadId($this->client, UploadId::fromParams(array(
- 'Bucket' => $this->commandOptions['Bucket'],
- 'Key' => $this->commandOptions['Key'],
- 'UploadId' => $this->state
- )));
- } elseif (!$this->state) {
- $this->state = $this->initiateMultipartUpload();
- }
-
- $options = array_replace(array(
- 'min_part_size' => $this->minPartSize,
- 'part_md5' => (bool) $this->calculatePartMd5,
- 'concurrency' => $this->concurrency
- ), $this->transferOptions);
-
- return $this->concurrency > 1
- ? new ParallelTransfer($this->client, $this->state, $this->source, $options)
- : new SerialTransfer($this->client, $this->state, $this->source, $options);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function initiateMultipartUpload()
- {
- // Determine Content-Type
- if (!isset($this->commandOptions['ContentType'])) {
- if ($mimeType = $this->source->getContentType()) {
- $this->commandOptions['ContentType'] = $mimeType;
- }
- }
-
- $params = array_replace(array(
- Ua::OPTION => Ua::MULTIPART_UPLOAD,
- 'command.headers' => $this->headers,
- 'Metadata' => array()
- ), $this->commandOptions);
-
- // Calculate the MD5 hash if none was set and it is asked of the builder
- if ($this->calculateEntireMd5) {
- $this->md5 = $this->source->getContentMd5();
- }
-
- // If an MD5 is specified, then add it to the custom headers of the request
- // so that it will be returned when downloading the object from Amazon S3
- if ($this->md5) {
- $params['Metadata']['x-amz-Content-MD5'] = $this->md5;
- }
-
- $result = $this->client->getCommand('CreateMultipartUpload', $params)->execute();
- // Create a new state based on the initiated upload
- $params['UploadId'] = $result['UploadId'];
-
- return new TransferState(UploadId::fromParams($params));
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadId.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadId.php
deleted file mode 100644
index 9d5f3842162..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadId.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model\MultipartUpload;
-
-use Aws\Common\Model\MultipartUpload\AbstractUploadId;
-
-/**
- * An object that encapsulates the identification for a Glacier upload part
- * @codeCoverageIgnore
- */
-class UploadId extends AbstractUploadId
-{
- /**
- * {@inheritdoc}
- */
- protected static $expectedValues = array(
- 'Bucket' => false,
- 'Key' => false,
- 'UploadId' => false
- );
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadPart.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadPart.php
deleted file mode 100644
index e0ded33abd4..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/MultipartUpload/UploadPart.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model\MultipartUpload;
-
-use Aws\Common\Model\MultipartUpload\AbstractUploadPart;
-
-/**
- * An object that encapsulates the data for a Glacier upload operation
- */
-class UploadPart extends AbstractUploadPart
-{
- /**
- * {@inheritdoc}
- */
- protected static $keyMap = array(
- 'PartNumber' => 'partNumber',
- 'ETag' => 'eTag',
- 'LastModified' => 'lastModified',
- 'Size' => 'size'
- );
-
- /**
- * @var string The ETag for this part
- */
- protected $eTag;
-
- /**
- * @var string The last modified date
- */
- protected $lastModified;
-
- /**
- * @var int The size (or content-length) in bytes of the upload body
- */
- protected $size;
-
- /**
- * @return string
- */
- public function getETag()
- {
- return $this->eTag;
- }
-
- /**
- * @return string
- */
- public function getLastModified()
- {
- return $this->lastModified;
- }
-
- /**
- * @return int
- */
- public function getSize()
- {
- return $this->size;
- }
-}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/PostObject.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/PostObject.php
deleted file mode 100644
index 0aa2dbcf7f2..00000000000
--- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Model/PostObject.php
+++ /dev/null
@@ -1,275 +0,0 @@
-<?php
-/**
- * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace Aws\S3\Model;
-
-use Aws\Common\Enum\DateFormat;
-use Aws\S3\S3Client;
-use Guzzle\Common\Collection;
-use Guzzle\Http\Url;
-
-/**
- * Encapsulates the logic for getting the data for an S3 object POST upload form
- */
-class PostObject extends Collection
-{
- /**
- * @var S3Client The S3 client being used to sign the policy
- */
- protected $client;
-
- /**
- * @var string The bucket name where the object will be posted
- */
- protected $bucket;
-
- /**
- * @var array The <form> tag attributes as an array
- */
- protected $formAttributes;
-
- /**
- * @var array The form's <input> elements as an array
- */
- protected $formInputs;
-
- /**
- * @var string The raw json policy
- */
- protected $jsonPolicy;
-
- /**
- * Constructs the PostObject
- *
- * The options array accepts the following keys:
- *
- * - acl: The access control setting to apply to the uploaded file. Accepts any of the
- * CannedAcl constants
- * - Cache-Control: The Cache-Control HTTP header value to apply to the uploaded file
- * - Content-Disposition: The Content-Disposition HTTP header value to apply to the uploaded file
- * - Content-Encoding: The Content-Encoding HTTP header value to apply to the uploaded file
- * - Content-Type: The Content-Type HTTP header value to apply to the uploaded file. The default
- * value is `application/octet-stream`
- * - Expires: The Expires HTTP header value to apply to the uploaded file
- * - key: The location where the file should be uploaded to. The default value is
- * `^${filename}` which will use the name of the uploaded file
- * - policy: A raw policy in JSON format. By default, the PostObject creates one for you
- * - policy_callback: A callback used to modify the policy before encoding and signing it. The
- * method signature for the callback should accept an array of the policy data as
- * the 1st argument, (optionally) the PostObject as the 2nd argument, and return
- * the policy data with the desired modifications.
- * - success_action_redirect: The URI for Amazon S3 to redirect to upon successful upload
- * - success_action_status: The status code for Amazon S3 to return upon successful upload
- * - ttd: The expiration time for the generated upload form data
- * - x-amz-meta-*: Any custom meta tag that should be set to the object
- * - x-amz-server-side-encryption: The server-side encryption mechanism to use
- * - x-amz-storage-class: The storage setting to apply to the object
- * - x-amz-server-side​-encryption​-customer-algorithm: The SSE-C algorithm
- * - x-amz-server-side​-encryption​-customer-key: The SSE-C customer secret key
- * - x-amz-server-side​-encryption​-customer-key-MD5: The MD5 hash of the SSE-C customer secret key
- *
- * For the Cache-Control, Content-Disposition, Content-Encoding,
- * Content-Type, Expires, and key options, to use a "starts-with" comparison
- * instead of an equals comparison, prefix the value with a ^ (carat)
- * character
- *
- * @param S3Client $client
- * @param $bucket
- * @param array $options
- */
- public function __construct(S3Client $client, $bucket, array $options = array())
- {
- $this->setClient($client);
- $this->setBucket($bucket);
- parent::__construct($options);
- }
-
- /**
- * Analyzes the provided data and turns it into useful data that can be
- * consumed and used to build an upload form
- *
- * @return PostObject
- */
- public function prepareData()
- {
- // Validate required options
- $options = Collection::fromConfig($this->data, array(
- 'ttd' => '+1 hour',
- 'key' => '^${filename}',
- ));
-
- // Format ttd option
- $ttd = $options['ttd'];
- $ttd = is_numeric($ttd) ? (int) $ttd : strtotime($ttd);
- unset($options['ttd']);
-
- // If a policy or policy callback were provided, extract those from the options
- $rawJsonPolicy = $options['policy'];
- $policyCallback = $options['policy_callback'];
- unset($options['policy'], $options['policy_callback']);
-
- // Setup policy document
- $policy = array(
- 'expiration' => gmdate(DateFormat::ISO8601_S3, $ttd),
- 'conditions' => array(array('bucket' => $this->bucket))
- );
-
- // Configure the endpoint/action
- $url = Url::factory($this->client->getBaseUrl());
- if ($url->getScheme() === 'https' && strpos($this->bucket, '.') !== false) {
- // Use path-style URLs
- $url->setPath($this->bucket);
- } else {
- // Use virtual-style URLs
- $url->setHost($this->bucket . '.' . $url->getHost());
- }
-
- // Setup basic form
- $this->formAttributes = array(
- 'action' => (string) $url,
- 'method' => 'POST',
- 'enctype' => 'multipart/form-data'
- );
- $this->formInputs = array(
- 'AWSAccessKeyId' => $this->client->getCredentials()->getAccessKeyId()
- );
-
- // Add success action status
- $status = (int) $options->get('success_action_status');
- if ($status && in_array($status, array(200, 201, 204))) {
- $this->formInputs['success_action_status'] = (string) $status;
- $policy['conditions'][] = array(
- 'success_action_status' => (string) $status
- );
- unset($options['success_action_status']);
- }
-
- // Add other options
- foreach ($options as $key => $value) {
- $value = (string) $value;
- if ($value[0] === '^') {
- $value = substr($value, 1);
- $this->formInputs[$key] = $value;
- $value = preg_replace('/\$\{(\w*)\}/', '', $value);
- $policy['conditions'][] = array('starts-with', '$' . $key, $value);
- } else {
- $this->formInputs[$key] = $value;
- $policy['conditions'][] = array($key => $value);
- }
- }
-
- // Handle the policy
- $policy = is_callable($policyCallback) ? $policyCallback($policy, $this) : $policy;
- $this->jsonPolicy = $rawJsonPolicy ?: json_encode($policy);
- $this->applyPolicy();
-
- return $this;
- }
-
- /**
- * Sets the S3 client
- *
- * @param S3Client $client
- *
- * @return PostObject
- */
- public function setClient(S3Client $client)
- {
- $this->client = $client;
-
- return $this;
- }
-
- /**
- * Gets the S3 client
- *
- * @return S3Client
- */
- public function getClient()
- {
- return $this->client;
- }
-
- /**
- * Sets the bucket and makes sure it is a valid bucket name
- *
- * @param string $bucket
- *
- * @return PostObject
- */
- public function setBucket($bucket)
- {
- $this->bucket = $bucket;
-
- return $this;
- }
-
- /**
- * Gets the bucket name
- *
- * @return string
- */
- public function getBucket()
- {
- return $this->bucket;
- }
-
- /**
- * Gets the form attributes as an array
- *
- * @return array
- */
- public function getFormAttributes()
- {
- return $this->formAttributes;
- }
-
- /**
- * Gets the form inputs as an array
- *
- * @return array
- */
- public function getFormInputs()
- {
- return $this->formInputs;
- }
-
- /**
- * Gets the raw JSON policy
- *
- * @return string
- */
- public function getJsonPolicy()
- {
- return $this->jsonPolicy;
- }
-
- /**
- * Handles the encoding, singing, and injecting of the policy
- */
- protected function applyPolicy()
- {
- $jsonPolicy64 = base64_encode($this->jsonPolicy);
- $this->formInputs['policy'] = $jsonPolicy64;
-
- $this->formInputs['signature'] = base64_encode(hash_hmac(
- 'sha1',
- $jsonPolicy64,
- $this->client->getCredentials()->getSecretKey(),
- true
- ));
- }
-}