diff options
Diffstat (limited to 'apps/files_external/3rdparty/aws-sdk-php/Aws')
233 files changed, 0 insertions, 22080 deletions
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Aws.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Aws.php deleted file mode 100644 index 9cd4ae2e16f..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Aws.php +++ /dev/null @@ -1,105 +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\Common; - -use Aws\Common\Facade\Facade; -use Guzzle\Service\Builder\ServiceBuilder; -use Guzzle\Service\Builder\ServiceBuilderLoader; - -/** - * Base class for interacting with web service clients - */ -class Aws extends ServiceBuilder -{ - /** - * @var string Current version of the SDK - */ - const VERSION = '2.7.5'; - - /** - * Create a new service locator for the AWS SDK - * - * You can configure the service locator is four different ways: - * - * 1. Use the default configuration file shipped with the SDK that wires class names with service short names and - * specify global parameters to add to every definition (e.g. key, secret, credentials, etc) - * - * 2. Use a custom configuration file that extends the default config and supplies credentials for each service. - * - * 3. Use a custom config file that wires services to custom short names for services. - * - * 4. If you are on Amazon EC2, you can use the default configuration file and not provide any credentials so that - * you are using InstanceProfile credentials. - * - * @param array|string $config The full path to a .php or .js|.json file, or an associative array of data - * to use as global parameters to pass to each service. - * @param array $globalParameters Global parameters to pass to every service as it is instantiated. - * - * @return Aws - */ - public static function factory($config = null, array $globalParameters = array()) - { - if (!$config) { - // If nothing is passed in, then use the default configuration file with credentials from the environment - $config = self::getDefaultServiceDefinition(); - } elseif (is_array($config)) { - // If an array was passed, then use the default configuration file with parameter overrides - $globalParameters = $config; - $config = self::getDefaultServiceDefinition(); - } - - $loader = new ServiceBuilderLoader(); - $loader->addAlias('_aws', self::getDefaultServiceDefinition()) - ->addAlias('_sdk1', __DIR__ . '/Resources/sdk1-config.php'); - - return $loader->load($config, $globalParameters); - } - - /** - * Get the full path to the default service builder definition file - * - * @return string - */ - public static function getDefaultServiceDefinition() - { - return __DIR__ . '/Resources/aws-config.php'; - } - - /** - * Returns the configuration for the service builder - * - * @return array - */ - public function getConfig() - { - return $this->builderConfig; - } - - /** - * Enables the facades for the clients defined in the service builder - * - * @param string|null $namespace The namespace that the facades should be mounted to. Defaults to global namespace - * - * @return Aws - */ - public function enableFacades($namespace = null) - { - Facade::mountFacades($this, $namespace); - - return $this; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/AbstractClient.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/AbstractClient.php deleted file mode 100644 index c9ee86a66ff..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/AbstractClient.php +++ /dev/null @@ -1,272 +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\Common\Client; - -use Aws\Common\Aws; -use Aws\Common\Credentials\CredentialsInterface; -use Aws\Common\Credentials\NullCredentials; -use Aws\Common\Enum\ClientOptions as Options; -use Aws\Common\Exception\InvalidArgumentException; -use Aws\Common\Exception\TransferException; -use Aws\Common\Signature\EndpointSignatureInterface; -use Aws\Common\Signature\SignatureInterface; -use Aws\Common\Signature\SignatureListener; -use Aws\Common\Waiter\WaiterClassFactory; -use Aws\Common\Waiter\CompositeWaiterFactory; -use Aws\Common\Waiter\WaiterFactoryInterface; -use Aws\Common\Waiter\WaiterConfigFactory; -use Guzzle\Common\Collection; -use Guzzle\Http\Exception\CurlException; -use Guzzle\Service\Client; -use Guzzle\Service\Description\ServiceDescriptionInterface; - -/** - * Abstract AWS client - */ -abstract class AbstractClient extends Client implements AwsClientInterface -{ - /** - * @var CredentialsInterface AWS credentials - */ - protected $credentials; - - /** - * @var SignatureInterface Signature implementation of the service - */ - protected $signature; - - /** - * @var WaiterFactoryInterface Factory used to create waiter classes - */ - protected $waiterFactory; - - /** - * {@inheritdoc} - */ - public static function getAllEvents() - { - return array_merge(Client::getAllEvents(), array( - 'client.region_changed', - 'client.credentials_changed', - )); - } - - /** - * @param CredentialsInterface $credentials AWS credentials - * @param SignatureInterface $signature Signature implementation - * @param Collection $config Configuration options - * - * @throws InvalidArgumentException if an endpoint provider isn't provided - */ - public function __construct(CredentialsInterface $credentials, SignatureInterface $signature, Collection $config) - { - // Bootstrap with Guzzle - parent::__construct($config->get(Options::BASE_URL), $config); - $this->credentials = $credentials; - $this->signature = $signature; - - // Make sure the user agent is prefixed by the SDK version - $this->setUserAgent('aws-sdk-php2/' . Aws::VERSION, true); - - // Add the event listener so that requests are signed before they are sent - $dispatcher = $this->getEventDispatcher(); - if (!$credentials instanceof NullCredentials) { - $dispatcher->addSubscriber(new SignatureListener($credentials, $signature)); - } - - if ($backoff = $config->get(Options::BACKOFF)) { - $dispatcher->addSubscriber($backoff, -255); - } - } - - public function __call($method, $args) - { - if (substr($method, 0, 3) === 'get' && substr($method, -8) === 'Iterator') { - // Allow magic method calls for iterators (e.g. $client->get<CommandName>Iterator($params)) - $commandOptions = isset($args[0]) ? $args[0] : null; - $iteratorOptions = isset($args[1]) ? $args[1] : array(); - return $this->getIterator(substr($method, 3, -8), $commandOptions, $iteratorOptions); - } elseif (substr($method, 0, 9) == 'waitUntil') { - // Allow magic method calls for waiters (e.g. $client->waitUntil<WaiterName>($params)) - return $this->waitUntil(substr($method, 9), isset($args[0]) ? $args[0]: array()); - } else { - return parent::__call(ucfirst($method), $args); - } - } - - /** - * Get an endpoint for a specific region from a service description - * @deprecated This function will no longer be updated to work with new regions. - */ - public static function getEndpoint(ServiceDescriptionInterface $description, $region, $scheme) - { - $service = $description->getData('serviceFullName'); - // Lookup the region in the service description - if (!($regions = $description->getData('regions'))) { - throw new InvalidArgumentException("No regions found in the {$service} description"); - } - // Ensure that the region exists for the service - if (!isset($regions[$region])) { - throw new InvalidArgumentException("{$region} is not a valid region for {$service}"); - } - // Ensure that the scheme is valid - if ($regions[$region][$scheme] == false) { - throw new InvalidArgumentException("{$scheme} is not a valid URI scheme for {$service} in {$region}"); - } - - return $scheme . '://' . $regions[$region]['hostname']; - } - - public function getCredentials() - { - return $this->credentials; - } - - public function setCredentials(CredentialsInterface $credentials) - { - $formerCredentials = $this->credentials; - $this->credentials = $credentials; - - // Dispatch an event that the credentials have been changed - $this->dispatch('client.credentials_changed', array( - 'credentials' => $credentials, - 'former_credentials' => $formerCredentials, - )); - - return $this; - } - - public function getSignature() - { - return $this->signature; - } - - public function getRegions() - { - return $this->serviceDescription->getData('regions'); - } - - public function getRegion() - { - return $this->getConfig(Options::REGION); - } - - public function setRegion($region) - { - $config = $this->getConfig(); - $formerRegion = $config->get(Options::REGION); - $global = $this->serviceDescription->getData('globalEndpoint'); - $provider = $config->get('endpoint_provider'); - - if (!$provider) { - throw new \RuntimeException('No endpoint provider configured'); - } - - // Only change the region if the service does not have a global endpoint - if (!$global || $this->serviceDescription->getData('namespace') === 'S3') { - - $endpoint = call_user_func( - $provider, - array( - 'scheme' => $config->get(Options::SCHEME), - 'region' => $region, - 'service' => $config->get(Options::SERVICE) - ) - ); - - $this->setBaseUrl($endpoint['endpoint']); - $config->set(Options::BASE_URL, $endpoint['endpoint']); - $config->set(Options::REGION, $region); - - // Update the signature if necessary - $signature = $this->getSignature(); - if ($signature instanceof EndpointSignatureInterface) { - /** @var $signature EndpointSignatureInterface */ - $signature->setRegionName($region); - } - - // Dispatch an event that the region has been changed - $this->dispatch('client.region_changed', array( - 'region' => $region, - 'former_region' => $formerRegion, - )); - } - - return $this; - } - - public function waitUntil($waiter, array $input = array()) - { - $this->getWaiter($waiter, $input)->wait(); - - return $this; - } - - public function getWaiter($waiter, array $input = array()) - { - return $this->getWaiterFactory()->build($waiter) - ->setClient($this) - ->setConfig($input); - } - - public function setWaiterFactory(WaiterFactoryInterface $waiterFactory) - { - $this->waiterFactory = $waiterFactory; - - return $this; - } - - public function getWaiterFactory() - { - if (!$this->waiterFactory) { - $clientClass = get_class($this); - // Use a composite factory that checks for classes first, then config waiters - $this->waiterFactory = new CompositeWaiterFactory(array( - new WaiterClassFactory(substr($clientClass, 0, strrpos($clientClass, '\\')) . '\\Waiter') - )); - if ($this->getDescription()) { - $waiterConfig = $this->getDescription()->getData('waiters') ?: array(); - $this->waiterFactory->addFactory(new WaiterConfigFactory($waiterConfig)); - } - } - - return $this->waiterFactory; - } - - public function getApiVersion() - { - return $this->serviceDescription->getApiVersion(); - } - - /** - * {@inheritdoc} - * @throws \Aws\Common\Exception\TransferException - */ - public function send($requests) - { - try { - return parent::send($requests); - } catch (CurlException $e) { - $wrapped = new TransferException($e->getMessage(), null, $e); - $wrapped->setCurlHandle($e->getCurlHandle()) - ->setCurlInfo($e->getCurlInfo()) - ->setError($e->getError(), $e->getErrorNo()) - ->setRequest($e->getRequest()); - throw $wrapped; - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/AwsClientInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/AwsClientInterface.php deleted file mode 100644 index 4c0579f64ad..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/AwsClientInterface.php +++ /dev/null @@ -1,118 +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\Common\Client; - -use Aws\Common\Credentials\CredentialsInterface; -use Aws\Common\Signature\SignatureInterface; -use Aws\Common\Waiter\WaiterFactoryInterface; -use Aws\Common\Waiter\WaiterInterface; -use Guzzle\Service\ClientInterface; - -/** - * Interface that all AWS clients implement - */ -interface AwsClientInterface extends ClientInterface -{ - /** - * Returns the AWS credentials associated with the client - * - * @return CredentialsInterface - */ - public function getCredentials(); - - /** - * Sets the credentials object associated with the client - * - * @param CredentialsInterface $credentials Credentials object to use - * - * @return self - */ - public function setCredentials(CredentialsInterface $credentials); - - /** - * Returns the signature implementation used with the client - * - * @return SignatureInterface - */ - public function getSignature(); - - /** - * Get a list of available regions and region data - * - * @return array - */ - public function getRegions(); - - /** - * Get the name of the region to which the client is configured to send requests - * - * @return string - */ - public function getRegion(); - - /** - * Change the region to which the client is configured to send requests - * - * @param string $region Name of the region - * - * @return self - */ - public function setRegion($region); - - /** - * Get the waiter factory being used by the client - * - * @return WaiterFactoryInterface - */ - public function getWaiterFactory(); - - /** - * Set the waiter factory to use with the client - * - * @param WaiterFactoryInterface $waiterFactory Factory used to create waiters - * - * @return self - */ - public function setWaiterFactory(WaiterFactoryInterface $waiterFactory); - - /** - * Wait until a resource is available or an associated waiter returns true - * - * @param string $waiter Name of the waiter - * @param array $input Values used as input for the underlying operation and to control the waiter - * - * @return self - */ - public function waitUntil($waiter, array $input = array()); - - /** - * Get a named waiter object - * - * @param string $waiter Name of the waiter - * @param array $input Values used as input for the underlying operation and to control the waiter - * - * @return WaiterInterface - */ - public function getWaiter($waiter, array $input = array()); - - /** - * Get the API version of the client (e.g. 2006-03-01) - * - * @return string - */ - public function getApiVersion(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/ClientBuilder.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/ClientBuilder.php deleted file mode 100644 index b34a67ffd92..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/ClientBuilder.php +++ /dev/null @@ -1,467 +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\Common\Client; - -use Aws\Common\Credentials\Credentials; -use Aws\Common\Credentials\CredentialsInterface; -use Aws\Common\Credentials\NullCredentials; -use Aws\Common\Enum\ClientOptions as Options; -use Aws\Common\Exception\ExceptionListener; -use Aws\Common\Exception\InvalidArgumentException; -use Aws\Common\Exception\NamespaceExceptionFactory; -use Aws\Common\Exception\Parser\DefaultXmlExceptionParser; -use Aws\Common\Exception\Parser\ExceptionParserInterface; -use Aws\Common\Iterator\AwsResourceIteratorFactory; -use Aws\Common\RulesEndpointProvider; -use Aws\Common\Signature\EndpointSignatureInterface; -use Aws\Common\Signature\SignatureInterface; -use Aws\Common\Signature\SignatureV2; -use Aws\Common\Signature\SignatureV3Https; -use Aws\Common\Signature\SignatureV4; -use Guzzle\Common\Collection; -use Guzzle\Plugin\Backoff\BackoffPlugin; -use Guzzle\Plugin\Backoff\CurlBackoffStrategy; -use Guzzle\Plugin\Backoff\ExponentialBackoffStrategy; -use Guzzle\Plugin\Backoff\HttpBackoffStrategy; -use Guzzle\Plugin\Backoff\TruncatedBackoffStrategy; -use Guzzle\Service\Description\ServiceDescription; -use Guzzle\Service\Resource\ResourceIteratorClassFactory; -use Guzzle\Log\LogAdapterInterface; -use Guzzle\Log\ClosureLogAdapter; -use Guzzle\Plugin\Backoff\BackoffLogger; - -/** - * Builder for creating AWS service clients - */ -class ClientBuilder -{ - /** - * @var array Default client config - */ - protected static $commonConfigDefaults = array('scheme' => 'https'); - - /** - * @var array Default client requirements - */ - protected static $commonConfigRequirements = array(Options::SERVICE_DESCRIPTION); - - /** - * @var string The namespace of the client - */ - protected $clientNamespace; - - /** - * @var array The config options - */ - protected $config = array(); - - /** - * @var array The config defaults - */ - protected $configDefaults = array(); - - /** - * @var array The config requirements - */ - protected $configRequirements = array(); - - /** - * @var ExceptionParserInterface The Parser interface for the client - */ - protected $exceptionParser; - - /** - * @var array Array of configuration data for iterators available for the client - */ - protected $iteratorsConfig = array(); - - /** - * Factory method for creating the client builder - * - * @param string $namespace The namespace of the client - * - * @return ClientBuilder - */ - public static function factory($namespace = null) - { - return new static($namespace); - } - - /** - * Constructs a client builder - * - * @param string $namespace The namespace of the client - */ - public function __construct($namespace = null) - { - $this->clientNamespace = $namespace; - } - - /** - * Sets the config options - * - * @param array|Collection $config The config options - * - * @return ClientBuilder - */ - public function setConfig($config) - { - $this->config = $this->processArray($config); - - return $this; - } - - /** - * Sets the config options' defaults - * - * @param array|Collection $defaults The default values - * - * @return ClientBuilder - */ - public function setConfigDefaults($defaults) - { - $this->configDefaults = $this->processArray($defaults); - - return $this; - } - - /** - * Sets the required config options - * - * @param array|Collection $required The required config options - * - * @return ClientBuilder - */ - public function setConfigRequirements($required) - { - $this->configRequirements = $this->processArray($required); - - return $this; - } - - /** - * Sets the exception parser. If one is not provided the builder will use - * the default XML exception parser. - * - * @param ExceptionParserInterface $parser The exception parser - * - * @return ClientBuilder - */ - public function setExceptionParser(ExceptionParserInterface $parser) - { - $this->exceptionParser = $parser; - - return $this; - } - - /** - * Set the configuration for the client's iterators - * - * @param array $config Configuration data for client's iterators - * - * @return ClientBuilder - */ - public function setIteratorsConfig(array $config) - { - $this->iteratorsConfig = $config; - - return $this; - } - - /** - * Performs the building logic using all of the parameters that have been - * set and falling back to default values. Returns an instantiate service - * client with credentials prepared and plugins attached. - * - * @return AwsClientInterface - * @throws InvalidArgumentException - */ - public function build() - { - // Resolve configuration - $config = Collection::fromConfig( - $this->config, - array_merge(self::$commonConfigDefaults, $this->configDefaults), - (self::$commonConfigRequirements + $this->configRequirements) - ); - - if (!isset($config['endpoint_provider'])) { - $config['endpoint_provider'] = RulesEndpointProvider::fromDefaults(); - } - - // Resolve the endpoint, signature, and credentials - $description = $this->updateConfigFromDescription($config); - $signature = $this->getSignature($description, $config); - $credentials = $this->getCredentials($config); - - // Resolve exception parser - if (!$this->exceptionParser) { - $this->exceptionParser = new DefaultXmlExceptionParser(); - } - - // Resolve backoff strategy - $backoff = $config->get(Options::BACKOFF); - if ($backoff === null) { - $backoff = new BackoffPlugin( - // Retry failed requests up to 3 times if it is determined that the request can be retried - new TruncatedBackoffStrategy(3, - // Retry failed requests with 400-level responses due to throttling - new ThrottlingErrorChecker($this->exceptionParser, - // Retry failed requests due to transient network or cURL problems - new CurlBackoffStrategy(null, - // Retry failed requests with 500-level responses - new HttpBackoffStrategy(array(500, 503, 509), - // Retry requests that failed due to expired credentials - new ExpiredCredentialsChecker($this->exceptionParser, - new ExponentialBackoffStrategy() - ) - ) - ) - ) - ) - ); - $config->set(Options::BACKOFF, $backoff); - } - - if ($backoff) { - $this->addBackoffLogger($backoff, $config); - } - - // Determine service and class name - $clientClass = 'Aws\Common\Client\DefaultClient'; - if ($this->clientNamespace) { - $serviceName = substr($this->clientNamespace, strrpos($this->clientNamespace, '\\') + 1); - $clientClass = $this->clientNamespace . '\\' . $serviceName . 'Client'; - } - - /** @var $client AwsClientInterface */ - $client = new $clientClass($credentials, $signature, $config); - $client->setDescription($description); - - // Add exception marshaling so that more descriptive exception are thrown - if ($this->clientNamespace) { - $exceptionFactory = new NamespaceExceptionFactory( - $this->exceptionParser, - "{$this->clientNamespace}\\Exception", - "{$this->clientNamespace}\\Exception\\{$serviceName}Exception" - ); - $client->addSubscriber(new ExceptionListener($exceptionFactory)); - } - - // Add the UserAgentPlugin to append to the User-Agent header of requests - $client->addSubscriber(new UserAgentListener()); - - // Filters used for the cache plugin - $client->getConfig()->set( - 'params.cache.key_filter', - 'header=date,x-amz-date,x-amz-security-token,x-amzn-authorization' - ); - - // Set the iterator resource factory based on the provided iterators config - $client->setResourceIteratorFactory(new AwsResourceIteratorFactory( - $this->iteratorsConfig, - new ResourceIteratorClassFactory($this->clientNamespace . '\\Iterator') - )); - - // Disable parameter validation if needed - if ($config->get(Options::VALIDATION) === false) { - $params = $config->get('command.params') ?: array(); - $params['command.disable_validation'] = true; - $config->set('command.params', $params); - } - - return $client; - } - - /** - * Add backoff logging to the backoff plugin if needed - * - * @param BackoffPlugin $plugin Backoff plugin - * @param Collection $config Configuration settings - * - * @throws InvalidArgumentException - */ - protected function addBackoffLogger(BackoffPlugin $plugin, Collection $config) - { - // The log option can be set to `debug` or an instance of a LogAdapterInterface - if ($logger = $config->get(Options::BACKOFF_LOGGER)) { - $format = $config->get(Options::BACKOFF_LOGGER_TEMPLATE); - if ($logger === 'debug') { - $logger = new ClosureLogAdapter(function ($message) { - trigger_error($message . "\n"); - }); - } elseif (!($logger instanceof LogAdapterInterface)) { - throw new InvalidArgumentException( - Options::BACKOFF_LOGGER . ' must be set to `debug` or an instance of ' - . 'Guzzle\\Common\\Log\\LogAdapterInterface' - ); - } - // Create the plugin responsible for logging exponential backoff retries - $logPlugin = new BackoffLogger($logger); - // You can specify a custom format or use the default - if ($format) { - $logPlugin->setTemplate($format); - } - $plugin->addSubscriber($logPlugin); - } - } - - /** - * Ensures that an array (e.g. for config data) is actually in array form - * - * @param array|Collection $array The array data - * - * @return array - * @throws InvalidArgumentException if the arg is not an array or Collection - */ - protected function processArray($array) - { - if ($array instanceof Collection) { - $array = $array->getAll(); - } - - if (!is_array($array)) { - throw new InvalidArgumentException('The config must be provided as an array or Collection.'); - } - - return $array; - } - - /** - * Update a configuration object from a service description - * - * @param Collection $config Config to update - * - * @return ServiceDescription - * @throws InvalidArgumentException - */ - protected function updateConfigFromDescription(Collection $config) - { - $description = $config->get(Options::SERVICE_DESCRIPTION); - if (!($description instanceof ServiceDescription)) { - // Inject the version into the sprintf template if it is a string - if (is_string($description)) { - $description = sprintf($description, $config->get(Options::VERSION)); - } - $description = ServiceDescription::factory($description); - $config->set(Options::SERVICE_DESCRIPTION, $description); - } - - if (!$config->get(Options::SERVICE)) { - $config->set(Options::SERVICE, $description->getData('endpointPrefix')); - } - - if ($iterators = $description->getData('iterators')) { - $this->setIteratorsConfig($iterators); - } - - // Make sure a valid region is set - $region = $config->get(Options::REGION); - $global = $description->getData('globalEndpoint'); - - if (!$global && !$region) { - throw new InvalidArgumentException( - 'A region is required when using ' . $description->getData('serviceFullName') - ); - } elseif ($global && (!$region || $description->getData('namespace') !== 'S3')) { - $region = 'us-east-1'; - $config->set(Options::REGION, 'us-east-1'); - } - - if (!$config->get(Options::BASE_URL)) { - $endpoint = call_user_func( - $config->get('endpoint_provider'), - array( - 'scheme' => $config->get(Options::SCHEME), - 'region' => $region, - 'service' => $config->get(Options::SERVICE) - ) - ); - $config->set(Options::BASE_URL, $endpoint['endpoint']); - - // Set a signature if one was not explicitly provided. - if (!$config->hasKey(Options::SIGNATURE) - && isset($endpoint['signatureVersion']) - ) { - $config->set(Options::SIGNATURE, $endpoint['signatureVersion']); - } - } - - return $description; - } - - /** - * Return an appropriate signature object for a a client based on the - * "signature" configuration setting, or the default signature specified in - * a service description. The signature can be set to a valid signature - * version identifier string or an instance of Aws\Common\Signature\SignatureInterface. - * - * @param ServiceDescription $description Description that holds a signature option - * @param Collection $config Configuration options - * - * @return SignatureInterface - * @throws InvalidArgumentException - */ - protected function getSignature(ServiceDescription $description, Collection $config) - { - // If a custom signature has not been provided, then use the default - // signature setting specified in the service description. - $signature = $config->get(Options::SIGNATURE) ?: $description->getData('signatureVersion'); - - if (is_string($signature)) { - if ($signature == 'v4') { - $signature = new SignatureV4(); - } elseif ($signature == 'v2') { - $signature = new SignatureV2(); - } elseif ($signature == 'v3https') { - $signature = new SignatureV3Https(); - } else { - throw new InvalidArgumentException("Invalid signature type: {$signature}"); - } - } elseif (!($signature instanceof SignatureInterface)) { - throw new InvalidArgumentException('The provided signature is not ' - . 'a signature version string or an instance of ' - . 'Aws\\Common\\Signature\\SignatureInterface'); - } - - // Allow a custom service name or region value to be provided - if ($signature instanceof EndpointSignatureInterface) { - - // Determine the service name to use when signing - $signature->setServiceName($config->get(Options::SIGNATURE_SERVICE) - ?: $description->getData('signingName') - ?: $description->getData('endpointPrefix')); - - // Determine the region to use when signing requests - $signature->setRegionName($config->get(Options::SIGNATURE_REGION) ?: $config->get(Options::REGION)); - } - - return $signature; - } - - protected function getCredentials(Collection $config) - { - $credentials = $config->get(Options::CREDENTIALS); - if ($credentials === false) { - $credentials = new NullCredentials(); - } elseif (!$credentials instanceof CredentialsInterface) { - $credentials = Credentials::factory($config); - } - - return $credentials; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/DefaultClient.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/DefaultClient.php deleted file mode 100644 index 1dc276d3ccb..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/DefaultClient.php +++ /dev/null @@ -1,67 +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\Common\Client; - -use Aws\Common\Enum\ClientOptions as Options; -use Guzzle\Common\Collection; - -/** - * Generic client for interacting with an AWS service - */ -class DefaultClient extends AbstractClient -{ - /** - * Factory method to create a default client using an array of configuration options. - * - * The following array keys and values are available options: - * - * Credential options ((`key`, `secret`, and optional `token`) OR `credentials` is required): - * - * - key: AWS Access Key ID - * - secret: AWS secret access key - * - credentials: You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object - * - token: Custom AWS security token to use with request authentication. Please note that not all services accept temporary credentials. See http://docs.aws.amazon.com/STS/latest/UsingSTS/UsingTokens.html - * - token.ttd: UNIX timestamp for when the custom credentials expire - * - credentials.cache.key: Optional custom cache key to use with the credentials - * - credentials.client: Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your credentials require a HTTP request (e.g. RefreshableInstanceProfileCredentials) - * - * Region and endpoint options (Some services do not require a region while others do. Check the service specific user guide documentation for details): - * - * - region: Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) - * - scheme: URI Scheme of the base URL (e.g. 'https', 'http') used when base_url is not supplied - * - base_url: Allows you to specify a custom endpoint instead of building one from the region and scheme - * - * Generic client options: - * - * - signature: Overrides the signature used by the client. Clients will always choose an appropriate default signature. However, it can be useful to override this with a custom setting. This can be set to "v4", "v3https", "v2" or an instance of Aws\Common\Signature\SignatureInterface. - * - ssl.certificate_authority: Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle - * - curl.options: Associative of CURLOPT_* cURL options to add to each request - * - client.backoff.logger: `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use 'debug' to emit PHP warnings when a retry is issued. - * - client.backoff.logger.template: Optional template to use for exponential backoff log messages. See `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information. - * - * @param array|Collection $config Client configuration data - * - * @return self - */ - public static function factory($config = array()) - { - return ClientBuilder::factory() - ->setConfig($config) - ->setConfigDefaults(array(Options::SCHEME => 'https')) - ->build(); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/ExpiredCredentialsChecker.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/ExpiredCredentialsChecker.php deleted file mode 100644 index d20f7f829d1..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/ExpiredCredentialsChecker.php +++ /dev/null @@ -1,80 +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\Common\Client; - -use Aws\Common\Credentials\AbstractRefreshableCredentials; -use Aws\Common\Client\AwsClientInterface; -use Aws\Common\Exception\Parser\ExceptionParserInterface; -use Guzzle\Http\Exception\HttpException; -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\Message\Response; -use Guzzle\Plugin\Backoff\BackoffStrategyInterface; -use Guzzle\Plugin\Backoff\AbstractBackoffStrategy; - -/** - * Backoff logic that handles retrying requests when credentials expire - */ -class ExpiredCredentialsChecker extends AbstractBackoffStrategy -{ - /** - * @var array Array of known retrying exception codes - */ - protected $retryable = array( - 'RequestExpired' => true, - 'ExpiredTokenException' => true, - 'ExpiredToken' => true - ); - - /** - * @var ExceptionParserInterface Exception parser used to parse exception responses - */ - protected $exceptionParser; - - public function __construct(ExceptionParserInterface $exceptionParser, BackoffStrategyInterface $next = null) { - $this->exceptionParser = $exceptionParser; - $this->next = $next; - } - - public function makesDecision() - { - return true; - } - - protected function getDelay($retries, RequestInterface $request, Response $response = null, HttpException $e = null) - { - if ($response && $response->isClientError()) { - - $parts = $this->exceptionParser->parse($request, $response); - if (!isset($this->retryable[$parts['code']]) || !$request->getClient()) { - return null; - } - - /** @var $client AwsClientInterface */ - $client = $request->getClient(); - // Only retry if the credentials can be refreshed - if (!($client->getCredentials() instanceof AbstractRefreshableCredentials)) { - return null; - } - - // Resign the request using new credentials - $client->getSignature()->signRequest($request, $client->getCredentials()->setExpiration(-1)); - - // Retry immediately with no delay - return 0; - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/ThrottlingErrorChecker.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/ThrottlingErrorChecker.php deleted file mode 100644 index a35cbcb157c..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/ThrottlingErrorChecker.php +++ /dev/null @@ -1,75 +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\Common\Client; - -use Aws\Common\Exception\Parser\ExceptionParserInterface; -use Guzzle\Http\Exception\HttpException; -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\Message\Response; -use Guzzle\Plugin\Backoff\BackoffStrategyInterface; -use Guzzle\Plugin\Backoff\AbstractBackoffStrategy; - -/** - * Backoff logic that handles throttling exceptions from services - */ -class ThrottlingErrorChecker extends AbstractBackoffStrategy -{ - /** @var array Whitelist of exception codes (as indexes) that indicate throttling */ - protected static $throttlingExceptions = array( - 'RequestLimitExceeded' => true, - 'Throttling' => true, - 'ThrottlingException' => true, - 'ProvisionedThroughputExceededException' => true, - 'RequestThrottled' => true, - ); - - /** - * @var ExceptionParserInterface Exception parser used to parse exception responses - */ - protected $exceptionParser; - - public function __construct(ExceptionParserInterface $exceptionParser, BackoffStrategyInterface $next = null) - { - $this->exceptionParser = $exceptionParser; - if ($next) { - $this->setNext($next); - } - } - - /** - * {@inheritdoc} - */ - public function makesDecision() - { - return true; - } - - /** - * {@inheritdoc} - */ - protected function getDelay( - $retries, - RequestInterface $request, - Response $response = null, - HttpException $e = null - ) { - if ($response && $response->isClientError()) { - $parts = $this->exceptionParser->parse($request, $response); - return isset(self::$throttlingExceptions[$parts['code']]) ? true : null; - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/UploadBodyListener.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/UploadBodyListener.php deleted file mode 100644 index a99d2fa910c..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/UploadBodyListener.php +++ /dev/null @@ -1,95 +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\Common\Client; - -use Aws\Common\Exception\InvalidArgumentException; -use Guzzle\Common\Event; -use Guzzle\Http\EntityBody; -use Guzzle\Service\Command\AbstractCommand as Command; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Prepares the body parameter of a command such that the parameter is more flexible (e.g. accepts file handles) with - * the value it accepts but converts it to the correct format for the command. Also looks for a "Filename" parameter. - */ -class UploadBodyListener implements EventSubscriberInterface -{ - /** - * @var array The names of the commands of which to modify the body parameter - */ - protected $commands; - - /** - * @var string The key for the upload body parameter - */ - protected $bodyParameter; - - /** - * @var string The key for the source file parameter - */ - protected $sourceParameter; - - /** - * @param array $commands The commands to modify - * @param string $bodyParameter The key for the body parameter - * @param string $sourceParameter The key for the source file parameter - */ - public function __construct(array $commands, $bodyParameter = 'Body', $sourceParameter = 'SourceFile') - { - $this->commands = $commands; - $this->bodyParameter = (string) $bodyParameter; - $this->sourceParameter = (string) $sourceParameter; - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() - { - return array('command.before_prepare' => array('onCommandBeforePrepare')); - } - - /** - * Converts filenames and file handles into EntityBody objects before the command is validated - * - * @param Event $event Event emitted - * @throws InvalidArgumentException - */ - public function onCommandBeforePrepare(Event $event) - { - /** @var $command Command */ - $command = $event['command']; - if (in_array($command->getName(), $this->commands)) { - // Get the interesting parameters - $source = $command->get($this->sourceParameter); - $body = $command->get($this->bodyParameter); - - // If a file path is passed in then get the file handle - if (is_string($source) && file_exists($source)) { - $body = fopen($source, 'r'); - } - - // Prepare the body parameter and remove the source file parameter - if (null !== $body) { - $command->remove($this->sourceParameter); - $command->set($this->bodyParameter, EntityBody::factory($body)); - } else { - throw new InvalidArgumentException("You must specify a non-null value for the {$this->bodyParameter} or {$this->sourceParameter} parameters."); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/UserAgentListener.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/UserAgentListener.php deleted file mode 100644 index cc7e312c064..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Client/UserAgentListener.php +++ /dev/null @@ -1,61 +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\Common\Client; - -use Guzzle\Common\Event; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Listener used to append strings to the User-Agent header of a request based - * on the `ua.append` option. `ua.append` can contain a string or array of values. - */ -class UserAgentListener implements EventSubscriberInterface -{ - /** - * @var string Option used to store User-Agent modifiers - */ - const OPTION = 'ua.append'; - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() - { - return array('command.before_send' => 'onBeforeSend'); - } - - /** - * Adds strings to the User-Agent header using the `ua.append` parameter of a command - * - * @param Event $event Event emitted - */ - public function onBeforeSend(Event $event) - { - $command = $event['command']; - if ($userAgentAppends = $command->get(self::OPTION)) { - $request = $command->getRequest(); - $userAgent = (string) $request->getHeader('User-Agent'); - foreach ((array) $userAgentAppends as $append) { - $append = ' ' . $append; - if (strpos($userAgent, $append) === false) { - $userAgent .= $append; - } - } - $request->setHeader('User-Agent', $userAgent); - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/AwsQueryVisitor.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/AwsQueryVisitor.php deleted file mode 100644 index dceaafaafc1..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/AwsQueryVisitor.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php - -namespace Aws\Common\Command; - -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Service\Description\Parameter; -use Guzzle\Service\Command\CommandInterface; -use Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor; - -/** - * Location visitor used to serialize AWS query parameters (e.g. EC2, SES, SNS, SQS, etc) as POST fields - */ -class AwsQueryVisitor extends AbstractRequestVisitor -{ - private $fqname; - - public function visit(CommandInterface $command, RequestInterface $request, Parameter $param, $value) - { - $this->fqname = $command->getName(); - $query = array(); - $this->customResolver($value, $param, $query, $param->getWireName()); - $request->addPostFields($query); - } - - /** - * Map nested parameters into the location_key based parameters - * - * @param array $value Value to map - * @param Parameter $param Parameter that holds information about the current key - * @param array $query Built up query string values - * @param string $prefix String to prepend to sub query values - */ - protected function customResolver($value, Parameter $param, array &$query, $prefix = '') - { - switch ($param->getType()) { - case 'object': - $this->resolveObject($param, $value, $prefix, $query); - break; - case 'array': - $this->resolveArray($param, $value, $prefix, $query); - break; - default: - $query[$prefix] = $param->filter($value); - } - } - - /** - * Custom handling for objects - * - * @param Parameter $param Parameter for the object - * @param array $value Value that is set for this parameter - * @param string $prefix Prefix for the resulting key - * @param array $query Query string array passed by reference - */ - protected function resolveObject(Parameter $param, array $value, $prefix, array &$query) - { - // Maps are implemented using additional properties - $hasAdditionalProperties = ($param->getAdditionalProperties() instanceof Parameter); - $additionalPropertyCount = 0; - - foreach ($value as $name => $v) { - if ($subParam = $param->getProperty($name)) { - // if the parameter was found by name as a regular property - $key = $prefix . '.' . $subParam->getWireName(); - $this->customResolver($v, $subParam, $query, $key); - } elseif ($hasAdditionalProperties) { - // Handle map cases like &Attribute.1.Name=<name>&Attribute.1.Value=<value> - $additionalPropertyCount++; - $data = $param->getData(); - $keyName = isset($data['keyName']) ? $data['keyName'] : 'key'; - $valueName = isset($data['valueName']) ? $data['valueName'] : 'value'; - $query["{$prefix}.{$additionalPropertyCount}.{$keyName}"] = $name; - $newPrefix = "{$prefix}.{$additionalPropertyCount}.{$valueName}"; - if (is_array($v)) { - $this->customResolver($v, $param->getAdditionalProperties(), $query, $newPrefix); - } else { - $query[$newPrefix] = $param->filter($v); - } - } - } - } - - /** - * Custom handling for arrays - * - * @param Parameter $param Parameter for the object - * @param array $value Value that is set for this parameter - * @param string $prefix Prefix for the resulting key - * @param array $query Query string array passed by reference - */ - protected function resolveArray(Parameter $param, array $value, $prefix, array &$query) - { - static $serializeEmpty = array( - 'SetLoadBalancerPoliciesForBackendServer' => 1, - 'SetLoadBalancerPoliciesOfListener' => 1, - 'UpdateStack' => 1 - ); - - // For BC, serialize empty lists for specific operations - if (!$value) { - if (isset($serializeEmpty[$this->fqname])) { - $query[$prefix] = ''; - } - return; - } - - $offset = $param->getData('offset') ?: 1; - foreach ($value as $index => $v) { - $index += $offset; - if (is_array($v) && $items = $param->getItems()) { - $this->customResolver($v, $items, $query, $prefix . '.' . $index); - } else { - $query[$prefix . '.' . $index] = $param->filter($v); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/JsonCommand.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/JsonCommand.php deleted file mode 100644 index 15ad5936d7c..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/JsonCommand.php +++ /dev/null @@ -1,47 +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\Common\Command; - -use Guzzle\Service\Command\OperationCommand; -use Guzzle\Http\Curl\CurlHandle; - -/** - * Adds AWS JSON body functionality to dynamically generated HTTP requests - */ -class JsonCommand extends OperationCommand -{ - /** - * {@inheritdoc} - */ - protected function build() - { - parent::build(); - - // Ensure that the body of the request ALWAYS includes some JSON. By default, this is an empty object. - if (!$this->request->getBody()) { - $this->request->setBody('{}'); - } - - // Never send the Expect header when interacting with a JSON query service - $this->request->removeHeader('Expect'); - - // Always send JSON requests as a raw string rather than using streams to avoid issues with - // cURL error code 65: "necessary data rewind wasn't possible". - // This could be removed after PHP addresses https://bugs.php.net/bug.php?id=47204 - $this->request->getCurlOptions()->set(CurlHandle::BODY_AS_STRING, true); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/QueryCommand.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/QueryCommand.php deleted file mode 100644 index 63eb8e80dbe..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/QueryCommand.php +++ /dev/null @@ -1,53 +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\Common\Command; - -use Guzzle\Service\Command\OperationCommand; - -/** - * Adds AWS Query service serialization - */ -class QueryCommand extends OperationCommand -{ - /** - * @var AwsQueryVisitor - */ - protected static $queryVisitor; - - /** - * @var XmlResponseLocationVisitor - */ - protected static $xmlVisitor; - - /** - * Register the aws.query visitor - */ - protected function init() - { - // @codeCoverageIgnoreStart - if (!self::$queryVisitor) { - self::$queryVisitor = new AwsQueryVisitor(); - } - if (!self::$xmlVisitor) { - self::$xmlVisitor = new XmlResponseLocationVisitor(); - } - // @codeCoverageIgnoreEnd - - $this->getRequestSerializer()->addVisitor('aws.query', self::$queryVisitor); - $this->getResponseParser()->addVisitor('xml', self::$xmlVisitor); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/XmlResponseLocationVisitor.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/XmlResponseLocationVisitor.php deleted file mode 100644 index ad229fde3d2..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Command/XmlResponseLocationVisitor.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -namespace Aws\Common\Command; - -use Guzzle\Service\Description\Operation; -use Guzzle\Service\Command\CommandInterface; -use Guzzle\Http\Message\Response; -use Guzzle\Service\Description\Parameter; -use Guzzle\Service\Command\LocationVisitor\Response\XmlVisitor; - -/** - * Class used for custom AWS XML response parsing of query services - */ -class XmlResponseLocationVisitor extends XmlVisitor -{ - /** - * {@inheritdoc} - */ - public function before(CommandInterface $command, array &$result) - { - parent::before($command, $result); - - // Unwrapped wrapped responses - $operation = $command->getOperation(); - if ($operation->getServiceDescription()->getData('resultWrapped')) { - $wrappingNode = $operation->getName() . 'Result'; - if (isset($result[$wrappingNode])) { - $result = $result[$wrappingNode] + $result; - unset($result[$wrappingNode]); - } - } - } - - /** - * Accounts for wrapper nodes - * {@inheritdoc} - */ - public function visit( - CommandInterface $command, - Response $response, - Parameter $param, - &$value, - $context = null - ) { - parent::visit($command, $response, $param, $value, $context); - - // Account for wrapper nodes (e.g. RDS, ElastiCache, etc) - if ($param->getData('wrapper')) { - $wireName = $param->getWireName(); - $value += $value[$wireName]; - unset($value[$wireName]); - } - } - - /** - * Filter used when converting XML maps into associative arrays in service descriptions - * - * @param array $value Value to filter - * @param string $entryName Name of each entry - * @param string $keyName Name of each key - * @param string $valueName Name of each value - * - * @return array Returns the map of the XML data - */ - public static function xmlMap($value, $entryName, $keyName, $valueName) - { - $result = array(); - foreach ($value as $entry) { - $result[$entry[$keyName]] = $entry[$valueName]; - } - - return $result; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/AbstractCredentialsDecorator.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/AbstractCredentialsDecorator.php deleted file mode 100644 index b3a1df967ec..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/AbstractCredentialsDecorator.php +++ /dev/null @@ -1,136 +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\Common\Credentials; - -/** - * Abstract credentials decorator - */ -class AbstractCredentialsDecorator implements CredentialsInterface -{ - /** - * @var CredentialsInterface Wrapped credentials object - */ - protected $credentials; - - /** - * Constructs a new BasicAWSCredentials object, with the specified AWS - * access key and AWS secret key - * - * @param CredentialsInterface $credentials - */ - public function __construct(CredentialsInterface $credentials) - { - $this->credentials = $credentials; - } - - /** - * {@inheritdoc} - */ - public function serialize() - { - return $this->credentials->serialize(); - } - - /** - * {@inheritdoc} - */ - public function unserialize($serialized) - { - $this->credentials = new Credentials('', ''); - $this->credentials->unserialize($serialized); - } - - /** - * {@inheritdoc} - */ - public function getAccessKeyId() - { - return $this->credentials->getAccessKeyId(); - } - - /** - * {@inheritdoc} - */ - public function getSecretKey() - { - return $this->credentials->getSecretKey(); - } - - /** - * {@inheritdoc} - */ - public function getSecurityToken() - { - return $this->credentials->getSecurityToken(); - } - - /** - * {@inheritdoc} - */ - public function getExpiration() - { - return $this->credentials->getExpiration(); - } - - /** - * {@inheritdoc} - */ - public function isExpired() - { - return $this->credentials->isExpired(); - } - - /** - * {@inheritdoc} - */ - public function setAccessKeyId($key) - { - $this->credentials->setAccessKeyId($key); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function setSecretKey($secret) - { - $this->credentials->setSecretKey($secret); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function setSecurityToken($token) - { - $this->credentials->setSecurityToken($token); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function setExpiration($timestamp) - { - $this->credentials->setExpiration($timestamp); - - return $this; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/AbstractRefreshableCredentials.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/AbstractRefreshableCredentials.php deleted file mode 100644 index 235bf9deef5..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/AbstractRefreshableCredentials.php +++ /dev/null @@ -1,76 +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\Common\Credentials; - -/** - * Abstract decorator to provide a foundation for refreshable credentials - */ -abstract class AbstractRefreshableCredentials extends AbstractCredentialsDecorator -{ - /** - * {@inheritdoc} - */ - public function getAccessKeyId() - { - if ($this->credentials->isExpired()) { - $this->refresh(); - } - - return $this->credentials->getAccessKeyId(); - } - - /** - * {@inheritdoc} - */ - public function getSecretKey() - { - if ($this->credentials->isExpired()) { - $this->refresh(); - } - - return $this->credentials->getSecretKey(); - } - - /** - * {@inheritdoc} - */ - public function getSecurityToken() - { - if ($this->credentials->isExpired()) { - $this->refresh(); - } - - return $this->credentials->getSecurityToken(); - } - - /** - * {@inheritdoc} - */ - public function serialize() - { - if ($this->credentials->isExpired()) { - $this->refresh(); - } - - return $this->credentials->serialize(); - } - - /** - * Attempt to get new credentials - */ - abstract protected function refresh(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/CacheableCredentials.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/CacheableCredentials.php deleted file mode 100644 index fbebf7815b9..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/CacheableCredentials.php +++ /dev/null @@ -1,73 +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\Common\Credentials; - -use Guzzle\Cache\CacheAdapterInterface; - -/** - * Credentials decorator used to implement caching credentials - */ -class CacheableCredentials extends AbstractRefreshableCredentials -{ - /** - * @var CacheAdapterInterface Cache adapter used to store credentials - */ - protected $cache; - - /** - * @var string Cache key used to store the credentials - */ - protected $cacheKey; - - /** - * CacheableCredentials is a decorator that decorates other credentials - * - * @param CredentialsInterface $credentials Credentials to adapt - * @param CacheAdapterInterface $cache Cache to use to store credentials - * @param string $cacheKey Cache key of the credentials - */ - public function __construct(CredentialsInterface $credentials, CacheAdapterInterface $cache, $cacheKey) - { - $this->credentials = $credentials; - $this->cache = $cache; - $this->cacheKey = $cacheKey; - } - - /** - * Attempt to get new credentials from cache or from the adapted object - */ - protected function refresh() - { - if (!$cache = $this->cache->fetch($this->cacheKey)) { - // The credentials were not found, so try again and cache if new - $this->credentials->getAccessKeyId(); - if (!$this->credentials->isExpired()) { - // The credentials were updated, so cache them - $this->cache->save($this->cacheKey, $this->credentials, $this->credentials->getExpiration() - time()); - } - } else { - // The credentials were found in cache, so update the adapter object - // if the cached credentials are not expired - if (!$cache->isExpired()) { - $this->credentials->setAccessKeyId($cache->getAccessKeyId()); - $this->credentials->setSecretKey($cache->getSecretKey()); - $this->credentials->setSecurityToken($cache->getSecurityToken()); - $this->credentials->setExpiration($cache->getExpiration()); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/Credentials.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/Credentials.php deleted file mode 100644 index 73b8ffa0005..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/Credentials.php +++ /dev/null @@ -1,337 +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\Common\Credentials; - -use Aws\Common\Enum\ClientOptions as Options; -use Aws\Common\Exception\InvalidArgumentException; -use Aws\Common\Exception\RequiredExtensionNotLoadedException; -use Aws\Common\Exception\RuntimeException; -use Guzzle\Common\FromConfigInterface; -use Guzzle\Cache\CacheAdapterInterface; -use Guzzle\Cache\DoctrineCacheAdapter; -use Guzzle\Common\Collection; - -/** - * Basic implementation of the AWSCredentials interface that allows callers to - * pass in the AWS access key and secret access in the constructor. - */ -class Credentials implements CredentialsInterface, FromConfigInterface -{ - const ENV_KEY = 'AWS_ACCESS_KEY_ID'; - const ENV_SECRET = 'AWS_SECRET_KEY'; - const ENV_SECRET_ACCESS_KEY = 'AWS_SECRET_ACCESS_KEY'; - const ENV_PROFILE = 'AWS_PROFILE'; - - /** @var string AWS Access Key ID */ - protected $key; - - /** @var string AWS Secret Access Key */ - protected $secret; - - /** @var string AWS Security Token */ - protected $token; - - /** @var int Time to die of token */ - protected $ttd; - - /** - * Get the available keys for the factory method - * - * @return array - */ - public static function getConfigDefaults() - { - return array( - Options::KEY => null, - Options::SECRET => null, - Options::TOKEN => null, - Options::TOKEN_TTD => null, - Options::PROFILE => null, - Options::CREDENTIALS_CACHE => null, - Options::CREDENTIALS_CACHE_KEY => null, - Options::CREDENTIALS_CLIENT => null - ); - } - - /** - * Factory method for creating new credentials. This factory method will - * create the appropriate credentials object with appropriate decorators - * based on the passed configuration options. - * - * @param array $config Options to use when instantiating the credentials - * - * @return CredentialsInterface - * @throws InvalidArgumentException If the caching options are invalid - * @throws RuntimeException If using the default cache and APC is disabled - */ - public static function factory($config = array()) - { - // Add default key values - foreach (self::getConfigDefaults() as $key => $value) { - if (!isset($config[$key])) { - $config[$key] = $value; - } - } - - // Start tracking the cache key - $cacheKey = $config[Options::CREDENTIALS_CACHE_KEY]; - - // Create the credentials object - if (!$config[Options::KEY] || !$config[Options::SECRET]) { - $credentials = self::createFromEnvironment($config); - // If no cache key was set, use the crc32 hostname of the server - $cacheKey = $cacheKey ?: 'credentials_' . crc32(gethostname()); - } else { - // Instantiate using short or long term credentials - $credentials = new static( - $config[Options::KEY], - $config[Options::SECRET], - $config[Options::TOKEN], - $config[Options::TOKEN_TTD] - ); - // If no cache key was set, use the access key ID - $cacheKey = $cacheKey ?: 'credentials_' . $config[Options::KEY]; - } - - // Check if the credentials are refreshable, and if so, configure caching - $cache = $config[Options::CREDENTIALS_CACHE]; - if ($cacheKey && $cache) { - $credentials = self::createCache($credentials, $cache, $cacheKey); - } - - return $credentials; - } - - /** - * Create credentials from the credentials ini file in the HOME directory. - * - * @param string|null $profile Pass a specific profile to use. If no - * profile is specified we will attempt to use - * the value specified in the AWS_PROFILE - * environment variable. If AWS_PROFILE is not - * set, the "default" profile is used. - * @param string|null $filename Pass a string to specify the location of the - * credentials files. If null is passed, the - * SDK will attempt to find the configuration - * file at in your HOME directory at - * ~/.aws/credentials. - * @return CredentialsInterface - * @throws \RuntimeException if the file cannot be found, if the file is - * invalid, or if the profile is invalid. - */ - public static function fromIni($profile = null, $filename = null) - { - if (!$filename) { - $filename = self::getHomeDir() . '/.aws/credentials'; - } - - if (!$profile) { - $profile = self::getEnvVar(self::ENV_PROFILE) ?: 'default'; - } - - if (!file_exists($filename) || !($data = parse_ini_file($filename, true))) { - throw new \RuntimeException("Invalid AWS credentials file: {$filename}."); - } - - if (empty($data[$profile])) { - throw new \RuntimeException("Invalid AWS credentials profile {$profile} in {$filename}."); - } - - return new self( - $data[$profile]['aws_access_key_id'], - $data[$profile]['aws_secret_access_key'], - isset($data[$profile]['aws_security_token']) - ? $data[$profile]['aws_security_token'] - : null - ); - } - - /** - * Constructs a new BasicAWSCredentials object, with the specified AWS - * access key and AWS secret key - * - * @param string $accessKeyId AWS access key ID - * @param string $secretAccessKey AWS secret access key - * @param string $token Security token to use - * @param int $expiration UNIX timestamp for when credentials expire - */ - public function __construct($accessKeyId, $secretAccessKey, $token = null, $expiration = null) - { - $this->key = trim($accessKeyId); - $this->secret = trim($secretAccessKey); - $this->token = $token; - $this->ttd = $expiration; - } - - public function serialize() - { - return json_encode(array( - Options::KEY => $this->key, - Options::SECRET => $this->secret, - Options::TOKEN => $this->token, - Options::TOKEN_TTD => $this->ttd - )); - } - - public function unserialize($serialized) - { - $data = json_decode($serialized, true); - $this->key = $data[Options::KEY]; - $this->secret = $data[Options::SECRET]; - $this->token = $data[Options::TOKEN]; - $this->ttd = $data[Options::TOKEN_TTD]; - } - - public function getAccessKeyId() - { - return $this->key; - } - - public function getSecretKey() - { - return $this->secret; - } - - public function getSecurityToken() - { - return $this->token; - } - - public function getExpiration() - { - return $this->ttd; - } - - public function isExpired() - { - return $this->ttd !== null && time() >= $this->ttd; - } - - public function setAccessKeyId($key) - { - $this->key = $key; - - return $this; - } - - public function setSecretKey($secret) - { - $this->secret = $secret; - - return $this; - } - - public function setSecurityToken($token) - { - $this->token = $token; - - return $this; - } - - public function setExpiration($timestamp) - { - $this->ttd = $timestamp; - - return $this; - } - - /** - * When no keys are provided, attempt to create them based on the - * environment or instance profile credentials. - * - * @param array|Collection $config - * - * @return CredentialsInterface - */ - private static function createFromEnvironment($config) - { - // Get key and secret from ENV variables - $envKey = self::getEnvVar(self::ENV_KEY); - if (!($envSecret = self::getEnvVar(self::ENV_SECRET))) { - // Use AWS_SECRET_ACCESS_KEY if AWS_SECRET_KEY was not set. - $envSecret = self::getEnvVar(self::ENV_SECRET_ACCESS_KEY); - } - - // Use credentials from the environment variables if available - if ($envKey && $envSecret) { - return new static($envKey, $envSecret); - } - - // Use credentials from the ini file in HOME directory if available - $home = self::getHomeDir(); - if ($home && file_exists("{$home}/.aws/credentials")) { - return self::fromIni($config[Options::PROFILE], "{$home}/.aws/credentials"); - } - - // Use instance profile credentials (available on EC2 instances) - return new RefreshableInstanceProfileCredentials( - new static('', '', '', 1), - $config[Options::CREDENTIALS_CLIENT] - ); - } - - private static function createCache(CredentialsInterface $credentials, $cache, $cacheKey) - { - if ($cache === 'true' || $cache === true) { - // If no cache adapter was provided, then create one for the user - // @codeCoverageIgnoreStart - if (!extension_loaded('apc')) { - throw new RequiredExtensionNotLoadedException('PHP has not been compiled with APC. Unable to cache ' - . 'the credentials.'); - } elseif (!class_exists('Doctrine\Common\Cache\ApcCache')) { - throw new RuntimeException( - 'Cannot set ' . Options::CREDENTIALS_CACHE . ' to true because the Doctrine cache component is ' - . 'not installed. Either install doctrine/cache or pass in an instantiated ' - . 'Guzzle\Cache\CacheAdapterInterface object' - ); - } - // @codeCoverageIgnoreEnd - $cache = new DoctrineCacheAdapter(new \Doctrine\Common\Cache\ApcCache()); - } elseif (!($cache instanceof CacheAdapterInterface)) { - throw new InvalidArgumentException('Unable to utilize caching with the specified options'); - } - - // Decorate the credentials with a cache - return new CacheableCredentials($credentials, $cache, $cacheKey); - } - - private static function getHomeDir() - { - // On Linux/Unix-like systems, use the HOME environment variable - if ($homeDir = self::getEnvVar('HOME')) { - return $homeDir; - } - - // Get the HOMEDRIVE and HOMEPATH values for Windows hosts - $homeDrive = self::getEnvVar('HOMEDRIVE'); - $homePath = self::getEnvVar('HOMEPATH'); - - return ($homeDrive && $homePath) ? $homeDrive . $homePath : null; - } - - /** - * Fetches the value of an environment variable by checking $_SERVER and getenv(). - * - * @param string $var Name of the environment variable - * - * @return mixed|null - */ - private static function getEnvVar($var) - { - return isset($_SERVER[$var]) ? $_SERVER[$var] : getenv($var); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/CredentialsInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/CredentialsInterface.php deleted file mode 100644 index dd4303767aa..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/CredentialsInterface.php +++ /dev/null @@ -1,96 +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\Common\Credentials; - -/** - * Provides access to the AWS credentials used for accessing AWS services: AWS - * access key ID, secret access key, and security token. These credentials are - * used to securely sign requests to AWS services. - */ -interface CredentialsInterface extends \Serializable -{ - /** - * Returns the AWS access key ID for this credentials object. - * - * @return string - */ - public function getAccessKeyId(); - - /** - * Returns the AWS secret access key for this credentials object. - * - * @return string - */ - public function getSecretKey(); - - /** - * Get the associated security token if available - * - * @return string|null - */ - public function getSecurityToken(); - - /** - * Get the UNIX timestamp in which the credentials will expire - * - * @return int|null - */ - public function getExpiration(); - - /** - * Set the AWS access key ID for this credentials object. - * - * @param string $key AWS access key ID - * - * @return self - */ - public function setAccessKeyId($key); - - /** - * Set the AWS secret access key for this credentials object. - * - * @param string $secret AWS secret access key - * - * @return CredentialsInterface - */ - public function setSecretKey($secret); - - /** - * Set the security token to use with this credentials object - * - * @param string $token Security token - * - * @return self - */ - public function setSecurityToken($token); - - /** - * Set the UNIX timestamp in which the credentials will expire - * - * @param int $timestamp UNIX timestamp expiration - * - * @return self - */ - public function setExpiration($timestamp); - - /** - * Check if the credentials are expired - * - * @return bool - */ - public function isExpired(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/NullCredentials.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/NullCredentials.php deleted file mode 100644 index 0656c391906..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/NullCredentials.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php -namespace Aws\Common\Credentials; - -/** - * A blank set of credentials. AWS clients must be provided credentials, but - * there are some types of requests that do not need authentication. This class - * can be used to pivot on that scenario, and also serve as a mock credentials - * object when testing - * - * @codeCoverageIgnore - */ -class NullCredentials implements CredentialsInterface -{ - public function getAccessKeyId() - { - return ''; - } - - public function getSecretKey() - { - return ''; - } - - public function getSecurityToken() - { - return null; - } - - public function getExpiration() - { - return null; - } - - public function isExpired() - { - return false; - } - - public function serialize() - { - return 'N;'; - } - - public function unserialize($serialized) - { - // Nothing to do here. - } - - public function setAccessKeyId($key) - { - // Nothing to do here. - } - - public function setSecretKey($secret) - { - // Nothing to do here. - } - - public function setSecurityToken($token) - { - // Nothing to do here. - } - - public function setExpiration($timestamp) - { - // Nothing to do here. - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/RefreshableInstanceProfileCredentials.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/RefreshableInstanceProfileCredentials.php deleted file mode 100644 index c4a9ef69624..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Credentials/RefreshableInstanceProfileCredentials.php +++ /dev/null @@ -1,59 +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\Common\Credentials; - -use Aws\Common\InstanceMetadata\InstanceMetadataClient; -use Aws\Common\Exception\InstanceProfileCredentialsException; - -/** - * Credentials decorator used to implement retrieving credentials from the - * EC2 metadata server - */ -class RefreshableInstanceProfileCredentials extends AbstractRefreshableCredentials -{ - /** - * @var InstanceMetadataClient - */ - protected $client; - - /** - * Constructs a new instance profile credentials decorator - * - * @param CredentialsInterface $credentials Credentials to adapt - * @param InstanceMetadataClient $client Client used to get new credentials - */ - public function __construct(CredentialsInterface $credentials, InstanceMetadataClient $client = null) - { - $this->credentials = $credentials; - $this->client = $client ?: InstanceMetadataClient::factory(); - } - - /** - * Attempt to get new credentials from the instance profile - * - * @throws InstanceProfileCredentialsException On error - */ - protected function refresh() - { - $credentials = $this->client->getInstanceProfileCredentials(); - // Expire the token 1 minute before it actually expires to pre-fetch before expiring - $this->credentials->setAccessKeyId($credentials->getAccessKeyId()) - ->setSecretKey($credentials->getSecretKey()) - ->setSecurityToken($credentials->getSecurityToken()) - ->setExpiration($credentials->getExpiration()); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum.php deleted file mode 100644 index 7f4d35672b4..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum.php +++ /dev/null @@ -1,55 +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\Common; - -/** - * Represents an enumerable set of values - */ -abstract class Enum -{ - /** - * @var array A cache of all enum values to increase performance - */ - protected static $cache = array(); - - /** - * Returns the names (or keys) of all of constants in the enum - * - * @return array - */ - public static function keys() - { - return array_keys(static::values()); - } - - /** - * Return the names and values of all the constants in the enum - * - * @return array - */ - public static function values() - { - $class = get_called_class(); - - if (!isset(self::$cache[$class])) { - $reflected = new \ReflectionClass($class); - self::$cache[$class] = $reflected->getConstants(); - } - - return self::$cache[$class]; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/ClientOptions.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/ClientOptions.php deleted file mode 100644 index 4027cae0b4a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/ClientOptions.php +++ /dev/null @@ -1,151 +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\Common\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable default factory options that can be passed to a client's factory method - */ -class ClientOptions extends Enum -{ - /** - * @var string AWS Access Key ID - */ - const KEY = 'key'; - - /** - * @var string AWS secret access key - */ - const SECRET = 'secret'; - - /** - * @var string You can optionally provide a custom `Aws\Common\Credentials\CredentialsInterface` object - */ - const CREDENTIALS = 'credentials'; - - /** - * @var string Name of a credential profile to read from your ~/.aws/credentials file - */ - const PROFILE = 'profile'; - - /** - * @var string Custom AWS security token to use with request authentication - */ - const TOKEN = 'token'; - - /** - * @var string UNIX timestamp for when the custom credentials expire - */ - const TOKEN_TTD = 'token.ttd'; - - /** - * @var string Used to cache credentials when using providers that require HTTP requests. Set the trueto use the - * default APC cache or provide a `Guzzle\Cache\CacheAdapterInterface` object. - */ - const CREDENTIALS_CACHE = 'credentials.cache'; - - /** - * @var string Optional custom cache key to use with the credentials - */ - const CREDENTIALS_CACHE_KEY = 'credentials.cache.key'; - - /** - * @var string Pass this option to specify a custom `Guzzle\Http\ClientInterface` to use if your credentials require - * a HTTP request (e.g. RefreshableInstanceProfileCredentials) - */ - const CREDENTIALS_CLIENT = 'credentials.client'; - - /** - * @var string Region name (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', etc...) - */ - const REGION = 'region'; - - /** - * @var string URI Scheme of the base URL (e.g. 'https', 'http'). - */ - const SCHEME = 'scheme'; - - /** - * @var string Specify the name of the service - */ - const SERVICE = 'service'; - - /** - * @var string Instead of using a `region` and `scheme`, you can specify a custom base URL for the client - */ - const BASE_URL = 'base_url'; - - /** - * @var string You can optionally provide a custom signature implementation used to sign requests - */ - const SIGNATURE = 'signature'; - - /** - * @var string Set to explicitly override the service name used in signatures - */ - const SIGNATURE_SERVICE = 'signature.service'; - - /** - * @var string Set to explicitly override the region name used in signatures - */ - const SIGNATURE_REGION = 'signature.region'; - - /** - * @var string Option key holding an exponential backoff plugin - */ - const BACKOFF = 'client.backoff'; - - /** - * @var string `Guzzle\Log\LogAdapterInterface` object used to log backoff retries. Use 'debug' to emit PHP - * warnings when a retry is issued. - */ - const BACKOFF_LOGGER = 'client.backoff.logger'; - - /** - * @var string Optional template to use for exponential backoff log messages. See - * `Guzzle\Plugin\Backoff\BackoffLogger` for formatting information. - */ - const BACKOFF_LOGGER_TEMPLATE = 'client.backoff.logger.template'; - - /** - * @var string Set to true to use the bundled CA cert or pass the full path to an SSL certificate bundle. This - * option should be modified when you encounter curl error code 60. Set to "system" to use the cacert - * bundle on your system. - */ - const SSL_CERT = 'ssl.certificate_authority'; - - /** - * @var string Service description to use with the client - */ - const SERVICE_DESCRIPTION = 'service.description'; - - /** - * @var string Whether or not modeled responses have transformations applied to them - */ - const MODEL_PROCESSING = 'command.model_processing'; - - /** - * @var bool Set to false to disable validation - */ - const VALIDATION = 'validation'; - - /** - * @var string API version used by the client - */ - const VERSION = 'version'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/DateFormat.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/DateFormat.php deleted file mode 100644 index 784ae92e037..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/DateFormat.php +++ /dev/null @@ -1,31 +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\Common\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable date format values used in the SDK - */ -class DateFormat extends Enum -{ - const ISO8601 = 'Ymd\THis\Z'; - const ISO8601_S3 = 'Y-m-d\TH:i:s\Z'; - const RFC1123 = 'D, d M Y H:i:s \G\M\T'; - const RFC2822 = \DateTime::RFC2822; - const SHORT = 'Ymd'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/Region.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/Region.php deleted file mode 100644 index 017d1d7e16c..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/Region.php +++ /dev/null @@ -1,63 +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\Common\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable region code values. These should be useful in most cases, - * with Amazon S3 being the most notable exception - * - * @link http://docs.aws.amazon.com/general/latest/gr/rande.html AWS Regions and Endpoints - */ -class Region extends Enum -{ - const US_EAST_1 = 'us-east-1'; - const VIRGINIA = 'us-east-1'; - const NORTHERN_VIRGINIA = 'us-east-1'; - - const US_WEST_1 = 'us-west-1'; - const CALIFORNIA = 'us-west-1'; - const NORTHERN_CALIFORNIA = 'us-west-1'; - - const US_WEST_2 = 'us-west-2'; - const OREGON = 'us-west-2'; - - const EU_WEST_1 = 'eu-west-1'; - const IRELAND = 'eu-west-1'; - - const EU_CENTRAL_1 = 'eu-central-1'; - const FRANKFURT = 'eu-central-1'; - - const AP_SOUTHEAST_1 = 'ap-southeast-1'; - const SINGAPORE = 'ap-southeast-1'; - - const AP_SOUTHEAST_2 = 'ap-southeast-2'; - const SYDNEY = 'ap-southeast-2'; - - const AP_NORTHEAST_1 = 'ap-northeast-1'; - const TOKYO = 'ap-northeast-1'; - - const SA_EAST_1 = 'sa-east-1'; - const SAO_PAULO = 'sa-east-1'; - - const CN_NORTH_1 = 'cn-north-1'; - const BEIJING = 'cn-north-1'; - - const US_GOV_WEST_1 = 'us-gov-west-1'; - const GOV_CLOUD_US = 'us-gov-west-1'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/Size.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/Size.php deleted file mode 100644 index 01deab688c8..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/Size.php +++ /dev/null @@ -1,53 +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\Common\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable byte-size values - */ -class Size extends Enum -{ - const B = 1; - const BYTE = 1; - const BYTES = 1; - - const KB = 1024; - const KILOBYTE = 1024; - const KILOBYTES = 1024; - - const MB = 1048576; - const MEGABYTE = 1048576; - const MEGABYTES = 1048576; - - const GB = 1073741824; - const GIGABYTE = 1073741824; - const GIGABYTES = 1073741824; - - const TB = 1099511627776; - const TERABYTE = 1099511627776; - const TERABYTES = 1099511627776; - - const PB = 1125899906842624; - const PETABYTE = 1125899906842624; - const PETABYTES = 1125899906842624; - - const EB = 1152921504606846976; - const EXABYTE = 1152921504606846976; - const EXABYTES = 1152921504606846976; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/Time.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/Time.php deleted file mode 100644 index 1b5a8f5b19f..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/Time.php +++ /dev/null @@ -1,46 +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\Common\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable time values - */ -class Time extends Enum -{ - const SECOND = 1; - const SECONDS = 1; - - const MINUTE = 60; - const MINUTES = 60; - - const HOUR = 3600; - const HOURS = 3600; - - const DAY = 86400; - const DAYS = 86400; - - const WEEK = 604800; - const WEEKS = 604800; - - const MONTH = 2592000; - const MONTHS = 2592000; - - const YEAR = 31557600; - const YEARS = 31557600; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/UaString.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/UaString.php deleted file mode 100644 index 8f1cb1ef28f..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Enum/UaString.php +++ /dev/null @@ -1,55 +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\Common\Enum; - -use Aws\Common\Enum; - -/** - * User-Agent header strings for various high level operations - */ -class UaString extends Enum -{ - /** - * @var string Name of the option used to add to the UA string - */ - const OPTION = 'ua.append'; - - /** - * @var string Resource iterator - */ - const ITERATOR = 'ITR'; - - /** - * @var string Resource waiter - */ - const WAITER = 'WTR'; - - /** - * @var string Session handlers (e.g. Amazon DynamoDB session handler) - */ - const SESSION = 'SES'; - - /** - * @var string Multipart upload helper for Amazon S3 - */ - const MULTIPART_UPLOAD = 'MUP'; - - /** - * @var string Command executed during a batch transfer - */ - const BATCH = 'BAT'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/AwsExceptionInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/AwsExceptionInterface.php deleted file mode 100644 index 36f84935b12..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/AwsExceptionInterface.php +++ /dev/null @@ -1,30 +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\Common\Exception; - -/** - * "Marker Interface" implemented by every exception in the AWS SDK - */ -interface AwsExceptionInterface -{ - public function getCode(); - public function getLine(); - public function getFile(); - public function getMessage(); - public function getPrevious(); - public function getTrace(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/BadMethodCallException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/BadMethodCallException.php deleted file mode 100644 index 1a233eebb68..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/BadMethodCallException.php +++ /dev/null @@ -1,22 +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\Common\Exception; - -/** - * AWS SDK namespaced version of the SPL BadMethodCallException. - */ -class BadMethodCallException extends \BadMethodCallException implements AwsExceptionInterface {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/DomainException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/DomainException.php deleted file mode 100644 index 137e1afe6df..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/DomainException.php +++ /dev/null @@ -1,22 +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\Common\Exception; - -/** - * AWS SDK namespaced version of the SPL DomainException. - */ -class DomainException extends \DomainException implements AwsExceptionInterface {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/ExceptionFactoryInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/ExceptionFactoryInterface.php deleted file mode 100644 index 08a4c2cea7b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/ExceptionFactoryInterface.php +++ /dev/null @@ -1,36 +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\Common\Exception; - -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\Message\Response; - -/** - * Interface used to create AWS exception - */ -interface ExceptionFactoryInterface -{ - /** - * Returns an AWS service specific exception - * - * @param RequestInterface $request Unsuccessful request - * @param Response $response Unsuccessful response that was encountered - * - * @return \Exception|AwsExceptionInterface - */ - public function fromResponse(RequestInterface $request, Response $response); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/ExceptionListener.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/ExceptionListener.php deleted file mode 100644 index 94d5ee4303e..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/ExceptionListener.php +++ /dev/null @@ -1,59 +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\Common\Exception; - -use Guzzle\Common\Event; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Converts generic Guzzle response exceptions into AWS specific exceptions - */ -class ExceptionListener implements EventSubscriberInterface -{ - /** - * @var ExceptionFactoryInterface Factory used to create new exceptions - */ - protected $factory; - - /** - * @param ExceptionFactoryInterface $factory Factory used to create exceptions - */ - public function __construct(ExceptionFactoryInterface $factory) - { - $this->factory = $factory; - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() - { - return array('request.error' => array('onRequestError', -1)); - } - - /** - * Throws a more meaningful request exception if available - * - * @param Event $event Event emitted - */ - public function onRequestError(Event $event) - { - $e = $this->factory->fromResponse($event['request'], $event['response']); - $event->stopPropagation(); - throw $e; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/InstanceProfileCredentialsException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/InstanceProfileCredentialsException.php deleted file mode 100644 index fb1dcf1dc31..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/InstanceProfileCredentialsException.php +++ /dev/null @@ -1,50 +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\Common\Exception; - -use Aws\Common\Exception\RuntimeException; - -/** - * Exception thrown when an error occurs with instance profile credentials - */ -class InstanceProfileCredentialsException extends RuntimeException -{ - /** - * @var string - */ - protected $statusCode; - - /** - * Set the error response code received from the instance metadata - * - * @param string $code Response code - */ - public function setStatusCode($code) - { - $this->statusCode = $code; - } - - /** - * Get the error response code from the service - * - * @return string|null - */ - public function getStatusCode() - { - return $this->statusCode; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/InvalidArgumentException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/InvalidArgumentException.php deleted file mode 100644 index 4360a008471..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,22 +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\Common\Exception; - -/** - * AWS SDK namespaced version of the SPL InvalidArgumentException. - */ -class InvalidArgumentException extends \InvalidArgumentException implements AwsExceptionInterface {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/LogicException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/LogicException.php deleted file mode 100644 index 5d658932144..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/LogicException.php +++ /dev/null @@ -1,22 +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\Common\Exception; - -/** - * AWS SDK namespaced version of the SPL LogicException. - */ -class LogicException extends \LogicException implements AwsExceptionInterface {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/MultipartUploadException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/MultipartUploadException.php deleted file mode 100644 index 3019361dd8e..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/MultipartUploadException.php +++ /dev/null @@ -1,55 +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\Common\Exception; - -use Aws\Common\Model\MultipartUpload\TransferStateInterface; - -/** - * Thrown when a {@see Aws\Common\MultipartUpload\TransferInterface} object encounters an error during transfer - */ -class MultipartUploadException extends RuntimeException -{ - /** - * @var TransferStateInterface State of the transfer when the error was encountered - */ - protected $state; - - /** - * @param TransferStateInterface $state Transfer state - * @param \Exception $exception Last encountered exception - */ - public function __construct(TransferStateInterface $state, \Exception $exception = null) - { - parent::__construct( - 'An error was encountered while performing a multipart upload: ' . $exception->getMessage(), - 0, - $exception - ); - - $this->state = $state; - } - - /** - * Get the state of the transfer - * - * @return TransferStateInterface - */ - public function getState() - { - return $this->state; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/NamespaceExceptionFactory.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/NamespaceExceptionFactory.php deleted file mode 100644 index 64890694306..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/NamespaceExceptionFactory.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\Common\Exception; - -use Aws\Common\Exception\Parser\ExceptionParserInterface; -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\Message\Response; - -/** - * Attempts to create exceptions by inferring the name from the code and a base - * namespace that contains exceptions. Exception classes are expected to be in - * upper camelCase and always end in 'Exception'. 'Exception' will be appended - * if it is not present in the exception code. - */ -class NamespaceExceptionFactory implements ExceptionFactoryInterface -{ - /** - * @var ExceptionParserInterface $parser Parser used to parse responses - */ - protected $parser; - - /** - * @var string Base namespace containing exception classes - */ - protected $baseNamespace; - - /** - * @var string Default class to instantiate if a match is not found - */ - protected $defaultException; - - /** - * @param ExceptionParserInterface $parser Parser used to parse exceptions - * @param string $baseNamespace Namespace containing exceptions - * @param string $defaultException Default class to use if one is not mapped - */ - public function __construct( - ExceptionParserInterface $parser, - $baseNamespace, - $defaultException = 'Aws\Common\Exception\ServiceResponseException' - ) { - $this->parser = $parser; - $this->baseNamespace = $baseNamespace; - $this->defaultException = $defaultException; - } - - /** - * {@inheritdoc} - */ - public function fromResponse(RequestInterface $request, Response $response) - { - $parts = $this->parser->parse($request, $response); - - // Removing leading 'AWS.' and embedded periods - $className = $this->baseNamespace . '\\' . str_replace(array('AWS.', '.'), '', $parts['code']); - if (substr($className, -9) !== 'Exception') { - $className .= 'Exception'; - } - - $className = class_exists($className) ? $className : $this->defaultException; - - return $this->createException($className, $request, $response, $parts); - } - - /** - * Create an prepare an exception object - * - * @param string $className Name of the class to create - * @param RequestInterface $request Request - * @param Response $response Response received - * @param array $parts Parsed exception data - * - * @return \Exception - */ - protected function createException($className, RequestInterface $request, Response $response, array $parts) - { - $class = new $className($parts['message']); - - if ($class instanceof ServiceResponseException) { - $class->setExceptionCode($parts['code']); - $class->setExceptionType($parts['type']); - $class->setResponse($response); - $class->setRequest($request); - $class->setRequestId($parts['request_id']); - } - - return $class; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/OutOfBoundsException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/OutOfBoundsException.php deleted file mode 100644 index 6738c0c3ee6..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/OutOfBoundsException.php +++ /dev/null @@ -1,22 +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\Common\Exception; - -/** - * AWS SDK namespaced version of the SPL OverflowException. - */ -class OutOfBoundsException extends \OutOfBoundsException implements AwsExceptionInterface {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/OverflowException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/OverflowException.php deleted file mode 100644 index 63e631cb2fe..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/OverflowException.php +++ /dev/null @@ -1,22 +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\Common\Exception; - -/** - * AWS SDK namespaced version of the SPL OverflowException. - */ -class OverflowException extends \OverflowException implements AwsExceptionInterface {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/AbstractJsonExceptionParser.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/AbstractJsonExceptionParser.php deleted file mode 100644 index 1e68d31405b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/AbstractJsonExceptionParser.php +++ /dev/null @@ -1,66 +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\Common\Exception\Parser; - -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\Message\Response; - -/** - * Parses JSON encoded exception responses - */ -abstract class AbstractJsonExceptionParser implements ExceptionParserInterface -{ - /** - * {@inheritdoc} - */ - public function parse(RequestInterface $request, Response $response) - { - // Build array of default error data - $data = array( - 'code' => null, - 'message' => null, - 'type' => $response->isClientError() ? 'client' : 'server', - 'request_id' => (string) $response->getHeader('x-amzn-RequestId'), - 'parsed' => null - ); - - // Parse the json and normalize key casings - if (null !== $json = json_decode($response->getBody(true), true)) { - $data['parsed'] = array_change_key_case($json); - } - - // Do additional, protocol-specific parsing and return the result - $data = $this->doParse($data, $response); - - // Remove "Fault" suffix from exception names - if (isset($data['code']) && strpos($data['code'], 'Fault')) { - $data['code'] = preg_replace('/^([a-zA-Z]+)Fault$/', '$1', $data['code']); - } - - return $data; - } - - /** - * Pull relevant exception data out of the parsed json - * - * @param array $data The exception data - * @param Response $response The response from the service containing the error - * - * @return array - */ - abstract protected function doParse(array $data, Response $response); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/DefaultXmlExceptionParser.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/DefaultXmlExceptionParser.php deleted file mode 100644 index a9fda69d827..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/DefaultXmlExceptionParser.php +++ /dev/null @@ -1,100 +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\Common\Exception\Parser; - -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\Message\Response; - -/** - * Parses default XML exception responses - */ -class DefaultXmlExceptionParser implements ExceptionParserInterface -{ - /** - * {@inheritdoc} - */ - public function parse(RequestInterface $request, Response $response) - { - $data = array( - 'code' => null, - 'message' => null, - 'type' => $response->isClientError() ? 'client' : 'server', - 'request_id' => null, - 'parsed' => null - ); - - if ($body = $response->getBody(true)) { - $this->parseBody(new \SimpleXMLElement($body), $data); - } else { - $this->parseHeaders($request, $response, $data); - } - - return $data; - } - - /** - * Parses additional exception information from the response headers - * - * @param RequestInterface $request Request that was issued - * @param Response $response The response from the request - * @param array $data The current set of exception data - */ - protected function parseHeaders(RequestInterface $request, Response $response, array &$data) - { - $data['message'] = $response->getStatusCode() . ' ' . $response->getReasonPhrase(); - if ($requestId = $response->getHeader('x-amz-request-id')) { - $data['request_id'] = $requestId; - $data['message'] .= " (Request-ID: $requestId)"; - } - } - - /** - * Parses additional exception information from the response body - * - * @param \SimpleXMLElement $body The response body as XML - * @param array $data The current set of exception data - */ - protected function parseBody(\SimpleXMLElement $body, array &$data) - { - $data['parsed'] = $body; - - $namespaces = $body->getDocNamespaces(); - if (isset($namespaces[''])) { - // Account for the default namespace being defined and PHP not being able to handle it :( - $body->registerXPathNamespace('ns', $namespaces['']); - $prefix = 'ns:'; - } else { - $prefix = ''; - } - - if ($tempXml = $body->xpath("//{$prefix}Code[1]")) { - $data['code'] = (string) $tempXml[0]; - } - - if ($tempXml = $body->xpath("//{$prefix}Message[1]")) { - $data['message'] = (string) $tempXml[0]; - } - - $tempXml = $body->xpath("//{$prefix}RequestId[1]"); - if (empty($tempXml)) { - $tempXml = $body->xpath("//{$prefix}RequestID[1]"); - } - if (isset($tempXml[0])) { - $data['request_id'] = (string) $tempXml[0]; - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/ExceptionParserInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/ExceptionParserInterface.php deleted file mode 100644 index 1b25d96f1f1..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/ExceptionParserInterface.php +++ /dev/null @@ -1,42 +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\Common\Exception\Parser; - -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\Message\Response; - -/** - * Interface used to parse exceptions into an associative array of data - */ -interface ExceptionParserInterface -{ - /** - * Parses an exception into an array of data containing at minimum the - * following array keys: - * - type: Exception type - * - code: Exception code - * - message: Exception message - * - request_id: Request ID - * - parsed: The parsed representation of the data (array, SimpleXMLElement, etc) - * - * @param RequestInterface $request - * @param Response $response Unsuccessful response - * - * @return array - */ - public function parse(RequestInterface $request, Response $response); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/JsonQueryExceptionParser.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/JsonQueryExceptionParser.php deleted file mode 100644 index 10af528bda4..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/JsonQueryExceptionParser.php +++ /dev/null @@ -1,39 +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\Common\Exception\Parser; - -use Guzzle\Http\Message\Response; - -/** - * Parses JSON encoded exception responses from query services - */ -class JsonQueryExceptionParser extends AbstractJsonExceptionParser -{ - /** - * {@inheritdoc} - */ - protected function doParse(array $data, Response $response) - { - if ($json = $data['parsed']) { - $parts = explode('#', $json['__type']); - $data['code'] = isset($parts[1]) ? $parts[1] : $parts[0]; - $data['message'] = isset($json['message']) ? $json['message'] : null; - } - - return $data; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/JsonRestExceptionParser.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/JsonRestExceptionParser.php deleted file mode 100644 index 5634f46b60e..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/Parser/JsonRestExceptionParser.php +++ /dev/null @@ -1,48 +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\Common\Exception\Parser; - -use Guzzle\Http\Message\Response; - -/** - * Parses JSON encoded exception responses from REST services - */ -class JsonRestExceptionParser extends AbstractJsonExceptionParser -{ - /** - * {@inheritdoc} - */ - protected function doParse(array $data, Response $response) - { - // Merge in error data from the JSON body - if ($json = $data['parsed']) { - $data = array_replace($data, $json); - } - - // Correct error type from services like Amazon Glacier - if (!empty($data['type'])) { - $data['type'] = strtolower($data['type']); - } - - // Retrieve the error code from services like Amazon Elastic Transcoder - if ($code = (string) $response->getHeader('x-amzn-ErrorType')) { - $data['code'] = substr($code, 0, strpos($code, ':')); - } - - return $data; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/RequiredExtensionNotLoadedException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/RequiredExtensionNotLoadedException.php deleted file mode 100644 index c4a072ca48d..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/RequiredExtensionNotLoadedException.php +++ /dev/null @@ -1,22 +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\Common\Exception; - -/** - * Thrown when a particular PHP extension is required to execute the guarded logic, but the extension is not loaded - */ -class RequiredExtensionNotLoadedException extends RuntimeException {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/RuntimeException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/RuntimeException.php deleted file mode 100644 index a5f3bce611f..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/RuntimeException.php +++ /dev/null @@ -1,22 +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\Common\Exception; - -/** - * AWS SDK namespaced version of the SPL RuntimeException. - */ -class RuntimeException extends \RuntimeException implements AwsExceptionInterface {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/ServiceResponseException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/ServiceResponseException.php deleted file mode 100644 index 76d831ddd7b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/ServiceResponseException.php +++ /dev/null @@ -1,183 +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\Common\Exception; - -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\Message\Response; - -/** - * Default AWS exception - */ -class ServiceResponseException extends RuntimeException -{ - /** - * @var Response Response - */ - protected $response; - - /** - * @var RequestInterface Request - */ - protected $request; - - /** - * @var string Request ID - */ - protected $requestId; - - /** - * @var string Exception type (client / server) - */ - protected $exceptionType; - - /** - * @var string Exception code - */ - protected $exceptionCode; - - /** - * Set the exception code - * - * @param string $code Exception code - */ - public function setExceptionCode($code) - { - $this->exceptionCode = $code; - } - - /** - * Get the exception code - * - * @return string|null - */ - public function getExceptionCode() - { - return $this->exceptionCode; - } - - /** - * Set the exception type - * - * @param string $type Exception type - */ - public function setExceptionType($type) - { - $this->exceptionType = $type; - } - - /** - * Get the exception type (one of client or server) - * - * @return string|null - */ - public function getExceptionType() - { - return $this->exceptionType; - } - - /** - * Set the request ID - * - * @param string $id Request ID - */ - public function setRequestId($id) - { - $this->requestId = $id; - } - - /** - * Get the Request ID - * - * @return string|null - */ - public function getRequestId() - { - return $this->requestId; - } - - /** - * Set the associated response - * - * @param Response $response Response - */ - public function setResponse(Response $response) - { - $this->response = $response; - } - - /** - * Get the associated response object - * - * @return Response|null - */ - public function getResponse() - { - return $this->response; - } - - /** - * Set the associated request - * - * @param RequestInterface $request - */ - public function setRequest(RequestInterface $request) - { - $this->request = $request; - } - - /** - * Get the associated request object - * - * @return RequestInterface|null - */ - public function getRequest() - { - return $this->request; - } - - /** - * Get the status code of the response - * - * @return int|null - */ - public function getStatusCode() - { - return $this->response ? $this->response->getStatusCode() : null; - } - - /** - * Cast to a string - * - * @return string - */ - public function __toString() - { - $message = get_class($this) . ': ' - . 'AWS Error Code: ' . $this->getExceptionCode() . ', ' - . 'Status Code: ' . $this->getStatusCode() . ', ' - . 'AWS Request ID: ' . $this->getRequestId() . ', ' - . 'AWS Error Type: ' . $this->getExceptionType() . ', ' - . 'AWS Error Message: ' . $this->getMessage(); - - // Add the User-Agent if available - if ($this->request) { - $message .= ', ' . 'User-Agent: ' . $this->request->getHeader('User-Agent'); - } - - return $message; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/TransferException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/TransferException.php deleted file mode 100644 index 47aa80d192b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/TransferException.php +++ /dev/null @@ -1,24 +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\Common\Exception; - -use Guzzle\Http\Exception\CurlException; - -/** - * Transfer request exception - */ -class TransferException extends CurlException implements AwsExceptionInterface {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/UnexpectedValueException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/UnexpectedValueException.php deleted file mode 100644 index 2de6fc6f71d..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Exception/UnexpectedValueException.php +++ /dev/null @@ -1,22 +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\Common\Exception; - -/** - * AWS SDK namespaced version of the SPL UnexpectedValueException. - */ -class UnexpectedValueException extends \UnexpectedValueException implements AwsExceptionInterface {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Facade/Facade.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Facade/Facade.php deleted file mode 100644 index 03797732841..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Facade/Facade.php +++ /dev/null @@ -1,67 +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\Common\Facade; - -use Aws\Common\Aws; - -/** - * Base facade class that handles the delegation logic - */ -abstract class Facade implements FacadeInterface -{ - /** @var Aws */ - protected static $serviceBuilder; - - /** - * Mounts the facades by extracting information from the service builder config and using creating class aliases - * - * @param string|null $targetNamespace Namespace that the facades should be mounted to. Defaults to global namespace - * - * @param Aws $serviceBuilder - */ - public static function mountFacades(Aws $serviceBuilder, $targetNamespace = null) - { - self::$serviceBuilder = $serviceBuilder; - require_once __DIR__ . '/facade-classes.php'; - foreach ($serviceBuilder->getConfig() as $service) { - if (isset($service['alias'], $service['class'])) { - $facadeClass = __NAMESPACE__ . '\\' . $service['alias']; - $facadeAlias = ltrim($targetNamespace . '\\' . $service['alias'], '\\'); - if (!class_exists($facadeAlias) && class_exists($facadeClass)) { - // @codeCoverageIgnoreStart - class_alias($facadeClass, $facadeAlias); - // @codeCoverageIgnoreEnd - } - } - } - } - - /** - * Returns the instance of the client that the facade operates on - * - * @return \Aws\Common\Client\AwsClientInterface - */ - public static function getClient() - { - return self::$serviceBuilder->get(static::getServiceBuilderKey()); - } - - public static function __callStatic($method, $args) - { - return call_user_func_array(array(self::getClient(), $method), $args); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Facade/FacadeInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Facade/FacadeInterface.php deleted file mode 100644 index b1325bbd292..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Facade/FacadeInterface.php +++ /dev/null @@ -1,32 +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\Common\Facade; - -/** - * Interface that defines a client facade. Facades are convenient static classes that allow you to run client methods - * statically on a default instance from the service builder. The facades themselves are aliased into the global - * namespace for ease of use. - */ -interface FacadeInterface -{ - /** - * Returns the key used to access the client instance from the Service Builder - * - * @return string - */ - public static function getServiceBuilderKey(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Facade/facade-classes.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Facade/facade-classes.php deleted file mode 100644 index b1041902be7..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Facade/facade-classes.php +++ /dev/null @@ -1,283 +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\Common\Facade; - -/** - * The following classes are used to implement the static client facades and are aliased into the global namespaced. We - * discourage the use of these classes directly by their full namespace since they are not autoloaded and are considered - * an implementation detail that could possibly be changed in the future. - */ - -// @codeCoverageIgnoreStart - -class AutoScaling extends Facade -{ - public static function getServiceBuilderKey() - { - return 'autoscaling'; - } -} - -class CloudFormation extends Facade -{ - public static function getServiceBuilderKey() - { - return 'cloudformation'; - } -} - -class CloudFront extends Facade -{ - public static function getServiceBuilderKey() - { - return 'cloudfront'; - } -} - -class CloudSearch extends Facade -{ - public static function getServiceBuilderKey() - { - return 'cloudsearch'; - } -} - -class CloudTrail extends Facade -{ - public static function getServiceBuilderKey() - { - return 'cloudtrail'; - } -} - -class CloudWatch extends Facade -{ - public static function getServiceBuilderKey() - { - return 'cloudwatch'; - } -} - -class DataPipeline extends Facade -{ - public static function getServiceBuilderKey() - { - return 'datapipeline'; - } -} - -class DirectConnect extends Facade -{ - public static function getServiceBuilderKey() - { - return 'directconnect'; - } -} - -class DynamoDb extends Facade -{ - public static function getServiceBuilderKey() - { - return 'dynamodb'; - } -} - -class Ec2 extends Facade -{ - public static function getServiceBuilderKey() - { - return 'ec2'; - } -} - -class ElastiCache extends Facade -{ - public static function getServiceBuilderKey() - { - return 'elasticache'; - } -} - -class ElasticBeanstalk extends Facade -{ - public static function getServiceBuilderKey() - { - return 'elasticbeanstalk'; - } -} - -class ElasticLoadBalancing extends Facade -{ - public static function getServiceBuilderKey() - { - return 'elasticloadbalancing'; - } -} - -class ElasticTranscoder extends Facade -{ - public static function getServiceBuilderKey() - { - return 'elastictranscoder'; - } -} - -class Emr extends Facade -{ - public static function getServiceBuilderKey() - { - return 'emr'; - } -} - -class Glacier extends Facade -{ - public static function getServiceBuilderKey() - { - return 'glacier'; - } -} - -class Iam extends Facade -{ - public static function getServiceBuilderKey() - { - return 'iam'; - } -} - -class ImportExport extends Facade -{ - public static function getServiceBuilderKey() - { - return 'importexport'; - } -} - -class Kinesis extends Facade -{ - public static function getServiceBuilderKey() - { - return 'kinesis'; - } -} - -class OpsWorks extends Facade -{ - public static function getServiceBuilderKey() - { - return 'opsworks'; - } -} - -class Rds extends Facade -{ - public static function getServiceBuilderKey() - { - return 'rds'; - } -} - -class Redshift extends Facade -{ - public static function getServiceBuilderKey() - { - return 'redshift'; - } -} - -class Route53 extends Facade -{ - public static function getServiceBuilderKey() - { - return 'route53'; - } -} - -class S3 extends Facade -{ - public static function getServiceBuilderKey() - { - return 's3'; - } -} - -class SimpleDb extends Facade -{ - public static function getServiceBuilderKey() - { - return 'sdb'; - } -} - -class Ses extends Facade -{ - public static function getServiceBuilderKey() - { - return 'ses'; - } -} - -class Sns extends Facade -{ - public static function getServiceBuilderKey() - { - return 'sns'; - } -} - -class Sqs extends Facade -{ - public static function getServiceBuilderKey() - { - return 'sqs'; - } -} - -class StorageGateway extends Facade -{ - public static function getServiceBuilderKey() - { - return 'storagegateway'; - } -} - -class Sts extends Facade -{ - public static function getServiceBuilderKey() - { - return 'sts'; - } -} - -class Support extends Facade -{ - public static function getServiceBuilderKey() - { - return 'support'; - } -} - -class Swf extends Facade -{ - public static function getServiceBuilderKey() - { - return 'swf'; - } -} - -// @codeCoverageIgnoreEnd diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/ChunkHash.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/ChunkHash.php deleted file mode 100644 index c57c3e4cb07..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/ChunkHash.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\Common\Hash; - -use Aws\Common\Exception\LogicException; - -/** - * Encapsulates the creation of a hash from streamed chunks of data - */ -class ChunkHash implements ChunkHashInterface -{ - /** - * @var resource The hash context as created by `hash_init()` - */ - protected $context; - - /** - * @var string The resulting hash in hex form - */ - protected $hash; - - /** - * @var string The resulting hash in binary form - */ - protected $hashRaw; - - /** - * {@inheritdoc} - */ - public function __construct($algorithm = self::DEFAULT_ALGORITHM) - { - HashUtils::validateAlgorithm($algorithm); - $this->context = hash_init($algorithm); - } - - /** - * {@inheritdoc} - */ - public function addData($data) - { - if (!$this->context) { - throw new LogicException('You may not add more data to a finalized chunk hash.'); - } - - hash_update($this->context, $data); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getHash($returnBinaryForm = false) - { - if (!$this->hash) { - $this->hashRaw = hash_final($this->context, true); - $this->hash = HashUtils::binToHex($this->hashRaw); - $this->context = null; - } - - return $returnBinaryForm ? $this->hashRaw : $this->hash; - } - - /** - * {@inheritdoc} - */ - public function __clone() - { - if ($this->context) { - $this->context = hash_copy($this->context); - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/ChunkHashInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/ChunkHashInterface.php deleted file mode 100644 index 5fcf9a56436..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/ChunkHashInterface.php +++ /dev/null @@ -1,52 +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\Common\Hash; - -/** - * Interface for objects that encapsulate the creation of a hash from streamed chunks of data - */ -interface ChunkHashInterface -{ - const DEFAULT_ALGORITHM = 'sha256'; - - /** - * Constructs the chunk hash and sets the algorithm to use for hashing - * - * @param string $algorithm A valid hash algorithm name as returned by `hash_algos()` - * - * @return self - */ - public function __construct($algorithm = 'sha256'); - - /** - * Add a chunk of data to be hashed - * - * @param string $data Data to be hashed - * - * @return self - */ - public function addData($data); - - /** - * Return the results of the hash - * - * @param bool $returnBinaryForm If true, returns the hash in binary form instead of hex form - * - * @return string - */ - public function getHash($returnBinaryForm = false); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/HashUtils.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/HashUtils.php deleted file mode 100644 index f66af6edf53..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/HashUtils.php +++ /dev/null @@ -1,76 +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\Common\Hash; - -use Aws\Common\Exception\InvalidArgumentException; - -/** - * Contains hashing utilities - */ -class HashUtils -{ - /** - * Converts a hash in hex form to binary form - * - * @param string $hash Hash in hex form - * - * @return string Hash in binary form - */ - public static function hexToBin($hash) - { - // If using PHP 5.4, there is a native function to convert from hex to binary - static $useNative; - if ($useNative === null) { - $useNative = function_exists('hex2bin'); - } - - if (!$useNative && strlen($hash) % 2 !== 0) { - $hash = '0' . $hash; - } - - return $useNative ? hex2bin($hash) : pack("H*", $hash); - } - - /** - * Converts a hash in binary form to hex form - * - * @param string $hash Hash in binary form - * - * @return string Hash in hex form - */ - public static function binToHex($hash) - { - return bin2hex($hash); - } - - /** - * Checks if the algorithm specified exists and throws an exception if it does not - * - * @param string $algorithm Name of the algorithm to validate - * - * @return bool - * @throws InvalidArgumentException if the algorithm doesn't exist - */ - public static function validateAlgorithm($algorithm) - { - if (!in_array($algorithm, hash_algos(), true)) { - throw new InvalidArgumentException("The hashing algorithm specified ({$algorithm}) does not exist."); - } - - return true; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/TreeHash.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/TreeHash.php deleted file mode 100644 index 26ce69286c0..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/TreeHash.php +++ /dev/null @@ -1,195 +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\Common\Hash; - -use Aws\Common\Enum\Size; -use Aws\Common\Exception\InvalidArgumentException; -use Aws\Common\Exception\LogicException; -use Guzzle\Http\EntityBody; - -/** - * Encapsulates the creation of a tree hash from streamed chunks of data - */ -class TreeHash implements ChunkHashInterface -{ - /** - * @var string The algorithm used for hashing - */ - protected $algorithm; - - /** - * @var array Set of binary checksums from which the tree hash is derived - */ - protected $checksums = array(); - - /** - * @var string The resulting hash in hex form - */ - protected $hash; - - /** - * @var string The resulting hash in binary form - */ - protected $hashRaw; - - /** - * Create a tree hash from an array of existing tree hash checksums - * - * @param array $checksums Set of checksums - * @param bool $inBinaryForm Whether or not the checksums are already in binary form - * @param string $algorithm A valid hash algorithm name as returned by `hash_algos()` - * - * @return TreeHash - */ - public static function fromChecksums(array $checksums, $inBinaryForm = false, $algorithm = self::DEFAULT_ALGORITHM) - { - $treeHash = new self($algorithm); - - // Convert checksums to binary form if provided in hex form and add them to the tree hash - $treeHash->checksums = $inBinaryForm ? $checksums : array_map('Aws\Common\Hash\HashUtils::hexToBin', $checksums); - - // Pre-calculate hash - $treeHash->getHash(); - - return $treeHash; - } - - /** - * Create a tree hash from a content body - * - * @param string|resource|EntityBody $content Content to create a tree hash for - * @param string $algorithm A valid hash algorithm name as returned by `hash_algos()` - * - * @return TreeHash - */ - public static function fromContent($content, $algorithm = self::DEFAULT_ALGORITHM) - { - $treeHash = new self($algorithm); - - // Read the data in 1MB chunks and add to tree hash - $content = EntityBody::factory($content); - while ($data = $content->read(Size::MB)) { - $treeHash->addData($data); - } - - // Pre-calculate hash - $treeHash->getHash(); - - return $treeHash; - } - - /** - * Validates an entity body with a tree hash checksum - * - * @param string|resource|EntityBody $content Content to create a tree hash for - * @param string $checksum The checksum to use for validation - * @param string $algorithm A valid hash algorithm name as returned by `hash_algos()` - * - * @return bool - */ - public static function validateChecksum($content, $checksum, $algorithm = self::DEFAULT_ALGORITHM) - { - $treeHash = self::fromContent($content, $algorithm); - - return ($checksum === $treeHash->getHash()); - } - - /** - * {@inheritdoc} - */ - public function __construct($algorithm = self::DEFAULT_ALGORITHM) - { - HashUtils::validateAlgorithm($algorithm); - $this->algorithm = $algorithm; - } - - /** - * {@inheritdoc} - * @throws LogicException if the root tree hash is already calculated - * @throws InvalidArgumentException if the data is larger than 1MB - */ - public function addData($data) - { - // Error if hash is already calculated - if ($this->hash) { - throw new LogicException('You may not add more data to a finalized tree hash.'); - } - - // Make sure that only 1MB chunks or smaller get passed in - if (strlen($data) > Size::MB) { - throw new InvalidArgumentException('The chunk of data added is too large for tree hashing.'); - } - - // Store the raw hash of this data segment - $this->checksums[] = hash($this->algorithm, $data, true); - - return $this; - } - - /** - * Add a checksum to the tree hash directly - * - * @param string $checksum The checksum to add - * @param bool $inBinaryForm Whether or not the checksum is already in binary form - * - * @return self - * @throws LogicException if the root tree hash is already calculated - */ - public function addChecksum($checksum, $inBinaryForm = false) - { - // Error if hash is already calculated - if ($this->hash) { - throw new LogicException('You may not add more checksums to a finalized tree hash.'); - } - - // Convert the checksum to binary form if necessary - $this->checksums[] = $inBinaryForm ? $checksum : HashUtils::hexToBin($checksum); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getHash($returnBinaryForm = false) - { - if (!$this->hash) { - // Perform hashes up the tree to arrive at the root checksum of the tree hash - $hashes = $this->checksums; - while (count($hashes) > 1) { - $sets = array_chunk($hashes, 2); - $hashes = array(); - foreach ($sets as $set) { - $hashes[] = (count($set) === 1) ? $set[0] : hash($this->algorithm, $set[0] . $set[1], true); - } - } - - $this->hashRaw = $hashes[0]; - $this->hash = HashUtils::binToHex($this->hashRaw); - } - - return $returnBinaryForm ? $this->hashRaw : $this->hash; - } - - /** - * @return array Array of raw checksums composing the tree hash - */ - public function getChecksums() - { - return $this->checksums; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/HostNameUtils.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/HostNameUtils.php deleted file mode 100644 index 4b791aa0be5..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/HostNameUtils.php +++ /dev/null @@ -1,85 +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\Common; - -use Guzzle\Http\Url; - -/** - * Utility class for parsing regions and services from URLs - */ -class HostNameUtils -{ - const DEFAULT_REGION = 'us-east-1'; - const DEFAULT_GOV_REGION = 'us-gov-west-1'; - - /** - * Parse the AWS region name from a URL - * - * - * @param Url $url HTTP URL - * - * @return string - * @link http://docs.aws.amazon.com/general/latest/gr/rande.html - */ - public static function parseRegionName(Url $url) - { - // If we don't recognize the domain, just return the default - if (substr($url->getHost(), -14) != '.amazonaws.com') { - return self::DEFAULT_REGION; - } - - $serviceAndRegion = substr($url->getHost(), 0, -14); - // Special handling for S3 regions - $separator = strpos($serviceAndRegion, 's3') === 0 ? '-' : '.'; - $separatorPos = strpos($serviceAndRegion, $separator); - - // If don't detect a separator, then return the default region - if ($separatorPos === false) { - return self::DEFAULT_REGION; - } - - $region = substr($serviceAndRegion, $separatorPos + 1); - - // All GOV regions currently use the default GOV region - if ($region == 'us-gov') { - return self::DEFAULT_GOV_REGION; - } - - return $region; - } - - /** - * Parse the AWS service name from a URL - * - * @param Url $url HTTP URL - * - * @return string Returns a service name (or empty string) - * @link http://docs.aws.amazon.com/general/latest/gr/rande.html - */ - public static function parseServiceName(Url $url) - { - // The service name is the first part of the host - $parts = explode('.', $url->getHost(), 2); - - // Special handling for S3 - if (stripos($parts[0], 's3') === 0) { - return 's3'; - } - - return $parts[0]; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/InstanceMetadata/InstanceMetadataClient.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/InstanceMetadata/InstanceMetadataClient.php deleted file mode 100644 index 229be1581e8..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/InstanceMetadata/InstanceMetadataClient.php +++ /dev/null @@ -1,102 +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\Common\InstanceMetadata; - -use Aws\Common\Enum\ClientOptions as Options; -use Aws\Common\Exception\InstanceProfileCredentialsException; -use Aws\Common\Credentials\Credentials; -use Aws\Common\Client\AbstractClient; -use Guzzle\Common\Collection; -use Guzzle\Http\Message\RequestFactory; - -/** - * Client used for interacting with the Amazon EC2 instance metadata server - */ -class InstanceMetadataClient extends AbstractClient -{ - /** - * Factory method to create a new InstanceMetadataClient using an array - * of configuration options. - * - * The configuration options accepts the following array keys and values: - * - base_url: Override the base URL of the instance metadata server - * - version: Version of the metadata server to interact with - * - * @param array|Collection $config Configuration options - * - * @return InstanceMetadataClient - */ - public static function factory($config = array()) - { - $config = Collection::fromConfig($config, array( - Options::BASE_URL => 'http://169.254.169.254/{version}/', - 'version' => 'latest', - 'request.options' => array( - 'connect_timeout' => 5, - 'timeout' => 10 - ) - ), array('base_url', 'version')); - - return new self($config); - } - - /** - * Constructor override - */ - public function __construct(Collection $config) - { - $this->setConfig($config); - $this->setBaseUrl($config->get(Options::BASE_URL)); - $this->defaultHeaders = new Collection(); - $this->setRequestFactory(RequestFactory::getInstance()); - } - - /** - * Get instance profile credentials - * - * @return Credentials - * @throws InstanceProfileCredentialsException - */ - public function getInstanceProfileCredentials() - { - try { - $request = $this->get('meta-data/iam/security-credentials/'); - $credentials = trim($request->send()->getBody(true)); - $result = $this->get("meta-data/iam/security-credentials/{$credentials}")->send()->json(); - } catch (\Exception $e) { - $message = sprintf('Error retrieving credentials from the instance profile metadata server. When you are' - . ' not running inside of Amazon EC2, you must provide your AWS access key ID and secret access key in' - . ' the "key" and "secret" options when creating a client or provide an instantiated' - . ' Aws\\Common\\Credentials\\CredentialsInterface object. (%s)', $e->getMessage()); - throw new InstanceProfileCredentialsException($message, $e->getCode()); - } - - // Ensure that the status code was successful - if ($result['Code'] !== 'Success') { - $e = new InstanceProfileCredentialsException('Unexpected response code: ' . $result['Code']); - $e->setStatusCode($result['Code']); - throw $e; - } - - return new Credentials( - $result['AccessKeyId'], - $result['SecretAccessKey'], - $result['Token'], - strtotime($result['Expiration']) - ); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/InstanceMetadata/Waiter/ServiceAvailable.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/InstanceMetadata/Waiter/ServiceAvailable.php deleted file mode 100644 index ac305c3d916..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/InstanceMetadata/Waiter/ServiceAvailable.php +++ /dev/null @@ -1,50 +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\Common\InstanceMetadata\Waiter; - -use Aws\Common\Waiter\AbstractResourceWaiter; -use Guzzle\Http\Exception\CurlException; - -/** - * Waits until the instance metadata service is responding. Will send up to - * 4 requests with a 5 second delay between each try. Each try can last up to - * 11 seconds to complete if the service is not responding. - * - * @codeCoverageIgnore - */ -class ServiceAvailable extends AbstractResourceWaiter -{ - protected $interval = 5; - protected $maxAttempts = 4; - - /** - * {@inheritdoc} - */ - public function doWait() - { - $request = $this->client->get(); - try { - $request->getCurlOptions()->set(CURLOPT_CONNECTTIMEOUT, 10) - ->set(CURLOPT_TIMEOUT, 10); - $request->send(); - - return true; - } catch (CurlException $e) { - return false; - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Iterator/AwsResourceIterator.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Iterator/AwsResourceIterator.php deleted file mode 100644 index cdd81199853..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Iterator/AwsResourceIterator.php +++ /dev/null @@ -1,169 +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\Common\Iterator; - -use Aws\Common\Enum\UaString as Ua; -use Aws\Common\Exception\RuntimeException; -Use Guzzle\Service\Resource\Model; -use Guzzle\Service\Resource\ResourceIterator; - -/** - * Iterate over a client command - */ -class AwsResourceIterator extends ResourceIterator -{ - /** - * @var Model Result of a command - */ - protected $lastResult = null; - - /** - * Provides access to the most recent result obtained by the iterator. This makes it easier to extract any - * additional information from the result which you do not have access to from the values emitted by the iterator - * - * @return Model|null - */ - public function getLastResult() - { - return $this->lastResult; - } - - /** - * {@inheritdoc} - * This AWS specific version of the resource iterator provides a default implementation of the typical AWS iterator - * process. It relies on configuration and extension to implement the operation-specific logic of handling results - * and nextTokens. This method will loop until resources are acquired or there are no more iterations available. - */ - protected function sendRequest() - { - do { - // Prepare the request including setting the next token - $this->prepareRequest(); - if ($this->nextToken) { - $this->applyNextToken(); - } - - // Execute the request and handle the results - $this->command->add(Ua::OPTION, Ua::ITERATOR); - $this->lastResult = $this->command->getResult(); - $resources = $this->handleResults($this->lastResult); - $this->determineNextToken($this->lastResult); - - // If no resources collected, prepare to reiterate before yielding - if ($reiterate = empty($resources) && $this->nextToken) { - $this->command = clone $this->originalCommand; - } - } while ($reiterate); - - return $resources; - } - - protected function prepareRequest() - { - // Get the limit parameter key to set - $limitKey = $this->get('limit_key'); - if ($limitKey && ($limit = $this->command->get($limitKey))) { - $pageSize = $this->calculatePageSize(); - - // If the limit of the command is different than the pageSize of the iterator, use the smaller value - if ($limit && $pageSize) { - $realLimit = min($limit, $pageSize); - $this->command->set($limitKey, $realLimit); - } - } - } - - protected function handleResults(Model $result) - { - $results = array(); - - // Get the result key that contains the results - if ($resultKey = $this->get('result_key')) { - $results = $this->getValueFromResult($result, $resultKey) ?: array(); - } - - return $results; - } - - protected function applyNextToken() - { - // Get the token parameter key to set - if ($tokenParam = $this->get('input_token')) { - // Set the next token. Works with multi-value tokens - if (is_array($tokenParam)) { - if (is_array($this->nextToken) && count($tokenParam) === count($this->nextToken)) { - foreach (array_combine($tokenParam, $this->nextToken) as $param => $token) { - $this->command->set($param, $token); - } - } else { - throw new RuntimeException('The definition of the iterator\'s token parameter and the actual token ' - . 'value are not compatible.'); - } - } else { - $this->command->set($tokenParam, $this->nextToken); - } - } - } - - protected function determineNextToken(Model $result) - { - $this->nextToken = null; - - // If the value of "more_results" is true or there is no "more_results" to check, then try to get the next token - $moreKey = $this->get('more_results'); - if ($moreKey === null || $this->getValueFromResult($result, $moreKey)) { - // Get the token key to check - if ($tokenKey = $this->get('output_token')) { - // Get the next token's value. Works with multi-value tokens - if (is_array($tokenKey)) { - $this->nextToken = array(); - foreach ($tokenKey as $key) { - $this->nextToken[] = $this->getValueFromResult($result, $key); - } - } else { - $this->nextToken = $this->getValueFromResult($result, $tokenKey); - } - } - } - } - - /** - * Extracts the value from the result using Collection::getPath. Also adds some additional logic for keys that need - * to access n-1 indexes (e.g., ImportExport, Kinesis). The n-1 logic only works for the known cases. We will switch - * to a jmespath implementation in the future to cover all cases - * - * @param Model $result - * @param string $key - * - * @return mixed|null - */ - protected function getValueFromResult(Model $result, $key) - { - // Special handling for keys that need to access n-1 indexes - if (strpos($key, '#') !== false) { - $keyParts = explode('#', $key, 2); - $items = $result->getPath(trim($keyParts[0], '/')); - if ($items && is_array($items)) { - $index = count($items) - 1; - $key = strtr($key, array('#' => $index)); - } - } - - // Get the value - return $result->getPath($key); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Iterator/AwsResourceIteratorFactory.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Iterator/AwsResourceIteratorFactory.php deleted file mode 100644 index ce668a289c4..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Iterator/AwsResourceIteratorFactory.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php - -namespace Aws\Common\Iterator; - -use Aws\Common\Exception\InvalidArgumentException; -use Guzzle\Common\Collection; -use Guzzle\Service\Command\CommandInterface; -use Guzzle\Service\Resource\ResourceIteratorFactoryInterface; - -/** - * Resource iterator factory used to instantiate the default AWS resource iterator with the correct configuration or - * use a concrete iterator class if one exists - */ -class AwsResourceIteratorFactory implements ResourceIteratorFactoryInterface -{ - /** - * @var array Default configuration values for iterators - */ - protected static $defaultIteratorConfig = array( - 'input_token' => null, - 'output_token' => null, - 'limit_key' => null, - 'result_key' => null, - 'more_results' => null, - ); - - /** - * @var array Legacy configuration options mapped to their new names - */ - private static $legacyConfigOptions = array( - 'token_param' => 'input_token', - 'token_key' => 'output_token', - 'limit_param' => 'limit_key', - 'more_key' => 'more_results', - ); - - /** - * @var array Iterator configuration for each iterable operation - */ - protected $config; - - /** - * @var ResourceIteratorFactoryInterface Another factory that will be used first to instantiate the iterator - */ - protected $primaryIteratorFactory; - - /** - * @param array $config An array of configuration values for the factory - * @param ResourceIteratorFactoryInterface $primaryIteratorFactory Another factory to use for chain of command - */ - public function __construct(array $config, ResourceIteratorFactoryInterface $primaryIteratorFactory = null) - { - $this->primaryIteratorFactory = $primaryIteratorFactory; - $this->config = array(); - foreach ($config as $name => $operation) { - $this->config[$name] = $operation + self::$defaultIteratorConfig; - } - } - - public function build(CommandInterface $command, array $options = array()) - { - // Get the configuration data for the command - $commandName = $command->getName(); - $commandSupported = isset($this->config[$commandName]); - $options = $this->translateLegacyConfigOptions($options); - $options += $commandSupported ? $this->config[$commandName] : array(); - - // Instantiate the iterator using the primary factory (if one was provided) - if ($this->primaryIteratorFactory && $this->primaryIteratorFactory->canBuild($command)) { - $iterator = $this->primaryIteratorFactory->build($command, $options); - } elseif (!$commandSupported) { - throw new InvalidArgumentException("Iterator was not found for {$commandName}."); - } else { - // Instantiate a generic AWS resource iterator - $iterator = new AwsResourceIterator($command, $options); - } - - return $iterator; - } - - public function canBuild(CommandInterface $command) - { - if ($this->primaryIteratorFactory) { - return $this->primaryIteratorFactory->canBuild($command); - } else { - return isset($this->config[$command->getName()]); - } - } - - /** - * @param array $config The config for a single operation - * - * @return array The modified config with legacy options translated - */ - private function translateLegacyConfigOptions($config) - { - foreach (self::$legacyConfigOptions as $legacyOption => $newOption) { - if (isset($config[$legacyOption])) { - $config[$newOption] = $config[$legacyOption]; - unset($config[$legacyOption]); - } - } - - return $config; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractTransfer.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractTransfer.php deleted file mode 100644 index 751b558d595..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractTransfer.php +++ /dev/null @@ -1,270 +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\Common\Model\MultipartUpload; - -use Aws\Common\Client\AwsClientInterface; -use Aws\Common\Exception\MultipartUploadException; -use Aws\Common\Exception\RuntimeException; -use Guzzle\Common\AbstractHasDispatcher; -use Guzzle\Http\EntityBody; -use Guzzle\Http\EntityBodyInterface; -use Guzzle\Service\Command\OperationCommand; -use Guzzle\Service\Resource\Model; - -/** - * Abstract class for transfer commonalities - */ -abstract class AbstractTransfer extends AbstractHasDispatcher implements TransferInterface -{ - const BEFORE_UPLOAD = 'multipart_upload.before_upload'; - const AFTER_UPLOAD = 'multipart_upload.after_upload'; - const BEFORE_PART_UPLOAD = 'multipart_upload.before_part_upload'; - const AFTER_PART_UPLOAD = 'multipart_upload.after_part_upload'; - const AFTER_ABORT = 'multipart_upload.after_abort'; - const AFTER_COMPLETE = 'multipart_upload.after_complete'; - - /** - * @var AwsClientInterface Client used for the transfers - */ - protected $client; - - /** - * @var TransferStateInterface State of the transfer - */ - protected $state; - - /** - * @var EntityBody Data source of the transfer - */ - protected $source; - - /** - * @var array Associative array of options - */ - protected $options; - - /** - * @var int Size of each part to upload - */ - protected $partSize; - - /** - * @var bool Whether or not the transfer has been stopped - */ - protected $stopped = false; - - /** - * Construct a new transfer object - * - * @param AwsClientInterface $client Client used for the transfers - * @param TransferStateInterface $state State used to track transfer - * @param EntityBody $source Data source of the transfer - * @param array $options Array of options to apply - */ - public function __construct( - AwsClientInterface $client, - TransferStateInterface $state, - EntityBody $source, - array $options = array() - ) { - $this->client = $client; - $this->state = $state; - $this->source = $source; - $this->options = $options; - - $this->init(); - - $this->partSize = $this->calculatePartSize(); - } - - public function __invoke() - { - return $this->upload(); - } - - /** - * {@inheritdoc} - */ - public static function getAllEvents() - { - return array( - self::BEFORE_PART_UPLOAD, - self::AFTER_UPLOAD, - self::BEFORE_PART_UPLOAD, - self::AFTER_PART_UPLOAD, - self::AFTER_ABORT, - self::AFTER_COMPLETE - ); - } - - /** - * {@inheritdoc} - */ - public function abort() - { - $command = $this->getAbortCommand(); - $result = $command->getResult(); - - $this->state->setAborted(true); - $this->stop(); - $this->dispatch(self::AFTER_ABORT, $this->getEventData($command)); - - return $result; - } - - /** - * {@inheritdoc} - */ - public function stop() - { - $this->stopped = true; - - return $this->state; - } - - /** - * {@inheritdoc} - */ - public function getState() - { - return $this->state; - } - - /** - * Get the array of options associated with the transfer - * - * @return array - */ - public function getOptions() - { - return $this->options; - } - - /** - * Set an option on the transfer - * - * @param string $option Name of the option - * @param mixed $value Value to set - * - * @return self - */ - public function setOption($option, $value) - { - $this->options[$option] = $value; - - return $this; - } - - /** - * Get the source body of the upload - * - * @return EntityBodyInterface - */ - public function getSource() - { - return $this->source; - } - - /** - * {@inheritdoc} - * @throws MultipartUploadException when an error is encountered. Use getLastException() to get more information. - * @throws RuntimeException when attempting to upload an aborted transfer - */ - public function upload() - { - if ($this->state->isAborted()) { - throw new RuntimeException('The transfer has been aborted and cannot be uploaded'); - } - - $this->stopped = false; - $eventData = $this->getEventData(); - $this->dispatch(self::BEFORE_UPLOAD, $eventData); - - try { - $this->transfer(); - $this->dispatch(self::AFTER_UPLOAD, $eventData); - - if ($this->stopped) { - return null; - } else { - $result = $this->complete(); - $this->dispatch(self::AFTER_COMPLETE, $eventData); - } - } catch (\Exception $e) { - throw new MultipartUploadException($this->state, $e); - } - - return $result; - } - - /** - * Get an array used for event notifications - * - * @param OperationCommand $command Command to include in event data - * - * @return array - */ - protected function getEventData(OperationCommand $command = null) - { - $data = array( - 'transfer' => $this, - 'source' => $this->source, - 'options' => $this->options, - 'client' => $this->client, - 'part_size' => $this->partSize, - 'state' => $this->state - ); - - if ($command) { - $data['command'] = $command; - } - - return $data; - } - - /** - * Hook to initialize the transfer - */ - protected function init() {} - - /** - * Determine the upload part size based on the size of the source data and - * taking into account the acceptable minimum and maximum part sizes. - * - * @return int The part size - */ - abstract protected function calculatePartSize(); - - /** - * Complete the multipart upload - * - * @return Model Returns the result of the complete multipart upload command - */ - abstract protected function complete(); - - /** - * Hook to implement in subclasses to perform the actual transfer - */ - abstract protected function transfer(); - - /** - * Fetches the abort command fom the concrete implementation - * - * @return OperationCommand - */ - abstract protected function getAbortCommand(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractTransferState.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractTransferState.php deleted file mode 100644 index 06d6c840167..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractTransferState.php +++ /dev/null @@ -1,164 +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\Common\Model\MultipartUpload; - -use Aws\Common\Exception\RuntimeException; - -/** - * State of a multipart upload - */ -abstract class AbstractTransferState implements TransferStateInterface -{ - /** - * @var UploadIdInterface Object holding params used to identity the upload part - */ - protected $uploadId; - - /** - * @var array Array of parts where the part number is the index - */ - protected $parts = array(); - - /** - * @var bool Whether or not the transfer was aborted - */ - protected $aborted = false; - - /** - * Construct a new transfer state object - * - * @param UploadIdInterface $uploadId Upload identifier object - */ - public function __construct(UploadIdInterface $uploadId) - { - $this->uploadId = $uploadId; - } - - /** - * {@inheritdoc} - */ - public function getUploadId() - { - return $this->uploadId; - } - - /** - * Get a data value from the transfer state's uploadId - * - * @param string $key Key to retrieve (e.g. Bucket, Key, UploadId, etc) - * - * @return string|null - */ - public function getFromId($key) - { - $params = $this->uploadId->toParams(); - - return isset($params[$key]) ? $params[$key] : null; - } - - /** - * {@inheritdoc} - */ - public function getPart($partNumber) - { - return isset($this->parts[$partNumber]) ? $this->parts[$partNumber] : null; - } - - /** - * {@inheritdoc} - */ - public function addPart(UploadPartInterface $part) - { - $partNumber = $part->getPartNumber(); - $this->parts[$partNumber] = $part; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function hasPart($partNumber) - { - return isset($this->parts[$partNumber]); - } - - /** - * {@inheritdoc} - */ - public function getPartNumbers() - { - return array_keys($this->parts); - } - - /** - * {@inheritdoc} - */ - public function setAborted($aborted) - { - $this->aborted = (bool) $aborted; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function isAborted() - { - return $this->aborted; - } - - /** - * {@inheritdoc} - */ - public function count() - { - return count($this->parts); - } - - /** - * {@inheritdoc} - */ - public function getIterator() - { - return new \ArrayIterator($this->parts); - } - - /** - * {@inheritdoc} - */ - public function serialize() - { - return serialize(get_object_vars($this)); - } - - /** - * {@inheritdoc} - */ - public function unserialize($serialized) - { - $data = unserialize($serialized); - foreach (get_object_vars($this) as $property => $oldValue) { - if (array_key_exists($property, $data)) { - $this->{$property} = $data[$property]; - } else { - throw new RuntimeException("The {$property} property could be restored during unserialization."); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractUploadBuilder.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractUploadBuilder.php deleted file mode 100644 index 8690d5cb562..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractUploadBuilder.php +++ /dev/null @@ -1,148 +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\Common\Model\MultipartUpload; - -use Aws\Common\Client\AwsClientInterface; -use Aws\Common\Exception\InvalidArgumentException; -use Guzzle\Http\EntityBody; - -/** - * Easily create a multipart uploader used to quickly and reliably upload a - * large file or data stream to Amazon S3 using multipart uploads - */ -abstract class AbstractUploadBuilder -{ - /** - * @var AwsClientInterface Client used to transfer requests - */ - protected $client; - - /** - * @var TransferStateInterface State of the transfer - */ - protected $state; - - /** - * @var EntityBody Source of the data - */ - protected $source; - - /** - * @var array Array of headers to set on the object - */ - protected $headers = array(); - - /** - * Return a new instance of the UploadBuilder - * - * @return static - */ - public static function newInstance() - { - return new static; - } - - /** - * Set the client used to connect to the AWS service - * - * @param AwsClientInterface $client Client to use - * - * @return $this - */ - public function setClient(AwsClientInterface $client) - { - $this->client = $client; - - return $this; - } - - /** - * Set the state of the upload. This is useful for resuming from a previously started multipart upload. - * You must use a local file stream as the data source if you wish to resume from a previous upload. - * - * @param TransferStateInterface|string $state Pass a TransferStateInterface object or the ID of the initiated - * multipart upload. When an ID is passed, the builder will create a - * state object using the data from a ListParts API response. - * - * @return $this - */ - public function resumeFrom($state) - { - $this->state = $state; - - return $this; - } - - /** - * Set the data source of the transfer - * - * @param resource|string|EntityBody $source Source of the transfer. Pass a string to transfer from a file on disk. - * You can also stream from a resource returned from fopen or a Guzzle - * {@see EntityBody} object. - * - * @return $this - * @throws InvalidArgumentException when the source cannot be found or opened - */ - public function setSource($source) - { - // Use the contents of a file as the data source - if (is_string($source)) { - if (!file_exists($source)) { - throw new InvalidArgumentException("File does not exist: {$source}"); - } - // Clear the cache so that we send accurate file sizes - clearstatcache(true, $source); - $source = fopen($source, 'r'); - } - - $this->source = EntityBody::factory($source); - - if ($this->source->isSeekable() && $this->source->getSize() == 0) { - throw new InvalidArgumentException('Empty body provided to upload builder'); - } - - return $this; - } - - /** - * Specify the headers to set on the upload - * - * @param array $headers Headers to add to the uploaded object - * - * @return $this - */ - public function setHeaders(array $headers) - { - $this->headers = $headers; - - return $this; - } - - /** - * Build the appropriate uploader based on the builder options - * - * @return TransferInterface - */ - abstract public function build(); - - /** - * Initiate the multipart upload - * - * @return TransferStateInterface - */ - abstract protected function initiateMultipartUpload(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractUploadId.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractUploadId.php deleted file mode 100644 index da7952164cb..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractUploadId.php +++ /dev/null @@ -1,89 +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\Common\Model\MultipartUpload; - -use Aws\Common\Exception\InvalidArgumentException; - -/** - * An object that encapsulates the data identifying an upload - */ -abstract class AbstractUploadId implements UploadIdInterface -{ - /** - * @var array Expected values (with defaults) - */ - protected static $expectedValues = array(); - - /** - * @var array Params representing the identifying information - */ - protected $data = array(); - - /** - * {@inheritdoc} - */ - public static function fromParams($data) - { - $uploadId = new static(); - $uploadId->loadData($data); - - return $uploadId; - } - - /** - * {@inheritdoc} - */ - public function toParams() - { - return $this->data; - } - - /** - * {@inheritdoc} - */ - public function serialize() - { - return serialize($this->data); - } - - /** - * {@inheritdoc} - */ - public function unserialize($serialized) - { - $this->loadData(unserialize($serialized)); - } - - /** - * Loads an array of data into the UploadId by extracting only the needed keys - * - * @param array $data Data to load - * - * @throws InvalidArgumentException if a required key is missing - */ - protected function loadData($data) - { - $data = array_replace(static::$expectedValues, array_intersect_key($data, static::$expectedValues)); - foreach ($data as $key => $value) { - if (isset($data[$key])) { - $this->data[$key] = $data[$key]; - } else { - throw new InvalidArgumentException("A required key [$key] was missing from the UploadId."); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractUploadPart.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractUploadPart.php deleted file mode 100644 index 1cf4c6d4fa3..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/AbstractUploadPart.php +++ /dev/null @@ -1,101 +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\Common\Model\MultipartUpload; - -use Aws\Common\Exception\InvalidArgumentException; - -/** - * An object that encapsulates the data for an upload part - */ -abstract class AbstractUploadPart implements UploadPartInterface -{ - /** - * @var array A map of external array keys to internal property names - */ - protected static $keyMap = array(); - - /** - * @var int The number of the upload part representing its order in the overall upload - */ - protected $partNumber; - - /** - * {@inheritdoc} - */ - public static function fromArray($data) - { - $part = new static(); - $part->loadData($data); - - return $part; - } - - /** - * {@inheritdoc} - */ - public function getPartNumber() - { - return $this->partNumber; - } - - /** - * {@inheritdoc} - */ - public function toArray() - { - $array = array(); - foreach (static::$keyMap as $key => $property) { - $array[$key] = $this->{$property}; - } - - return $array; - } - - /** - * {@inheritdoc} - */ - public function serialize() - { - return serialize($this->toArray()); - } - - /** - * {@inheritdoc} - */ - public function unserialize($serialized) - { - $this->loadData(unserialize($serialized)); - } - - /** - * Loads an array of data into the upload part by extracting only the needed keys - * - * @param array|\Traversable $data Data to load into the upload part value object - * - * @throws InvalidArgumentException if a required key is missing - */ - protected function loadData($data) - { - foreach (static::$keyMap as $key => $property) { - if (isset($data[$key])) { - $this->{$property} = $data[$key]; - } else { - throw new InvalidArgumentException("A required key [$key] was missing from the upload part."); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/TransferInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/TransferInterface.php deleted file mode 100644 index 1fc1ae9bb9b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/TransferInterface.php +++ /dev/null @@ -1,66 +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\Common\Model\MultipartUpload; - -use Guzzle\Common\HasDispatcherInterface; -use Guzzle\Service\Resource\Model; - -/** - * Interface for transferring the contents of a data source to an AWS service via a multipart upload interface - */ -interface TransferInterface extends HasDispatcherInterface -{ - /** - * Upload the source to using a multipart upload - * - * @return Model|null Result of the complete multipart upload command or null if uploading was stopped - */ - public function upload(); - - /** - * Abort the upload - * - * @return Model Returns the result of the abort multipart upload command - */ - public function abort(); - - /** - * Get the current state of the upload - * - * @return TransferStateInterface - */ - public function getState(); - - /** - * Stop the transfer and retrieve the current state. - * - * This allows you to stop and later resume a long running transfer if needed. - * - * @return TransferStateInterface - */ - public function stop(); - - /** - * Set an option on the transfer object - * - * @param string $option Option to set - * @param mixed $value The value to set - * - * @return self - */ - public function setOption($option, $value); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/TransferStateInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/TransferStateInterface.php deleted file mode 100644 index 7f5c0e50dfd..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/TransferStateInterface.php +++ /dev/null @@ -1,92 +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\Common\Model\MultipartUpload; - -use Aws\Common\Client\AwsClientInterface; - -/** - * State of a multipart upload - */ -interface TransferStateInterface extends \Countable, \IteratorAggregate, \Serializable -{ - /** - * Create the transfer state from the results of list parts request - * - * @param AwsClientInterface $client Client used to send the request - * @param UploadIdInterface $uploadId Params needed to identify the upload and form the request - * - * @return self - */ - public static function fromUploadId(AwsClientInterface $client, UploadIdInterface $uploadId); - - /** - * Get the params used to identify an upload part - * - * @return UploadIdInterface - */ - public function getUploadId(); - - /** - * Get the part information of a specific part - * - * @param int $partNumber Part to retrieve - * - * @return UploadPartInterface - */ - public function getPart($partNumber); - - /** - * Add a part to the transfer state - * - * @param UploadPartInterface $part The part to add - * - * @return self - */ - public function addPart(UploadPartInterface $part); - - /** - * Check if a specific part has been uploaded - * - * @param int $partNumber Part to check - * - * @return bool - */ - public function hasPart($partNumber); - - /** - * Get a list of all of the uploaded part numbers - * - * @return array - */ - public function getPartNumbers(); - - /** - * Set whether or not the transfer has been aborted - * - * @param bool $aborted Set to true to mark the transfer as aborted - * - * @return self - */ - public function setAborted($aborted); - - /** - * Check if the transfer has been marked as aborted - * - * @return bool - */ - public function isAborted(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/UploadIdInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/UploadIdInterface.php deleted file mode 100644 index dd14b17790f..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/UploadIdInterface.php +++ /dev/null @@ -1,39 +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\Common\Model\MultipartUpload; - -/** - * An object that encapsulates the data identifying an upload - */ -interface UploadIdInterface extends \Serializable -{ - /** - * Create an UploadId from an array - * - * @param array $data Data representing the upload identification - * - * @return self - */ - public static function fromParams($data); - - /** - * Returns the array form of the upload identification for use as command params - * - * @return array - */ - public function toParams(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/UploadPartInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/UploadPartInterface.php deleted file mode 100644 index 6d446d4f08c..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Model/MultipartUpload/UploadPartInterface.php +++ /dev/null @@ -1,46 +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\Common\Model\MultipartUpload; - -/** - * An object that encapsulates the data for an upload part - */ -interface UploadPartInterface extends \Serializable -{ - /** - * Create an upload part from an array - * - * @param array|\Traversable $data Data representing the upload part - * - * @return self - */ - public static function fromArray($data); - - /** - * Returns the part number of the upload part which is used as an identifier - * - * @return int - */ - public function getPartNumber(); - - /** - * Returns the array form of the upload part - * - * @return array - */ - public function toArray(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Resources/aws-config.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Resources/aws-config.php deleted file mode 100644 index 710ad0d3385..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Resources/aws-config.php +++ /dev/null @@ -1,296 +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. - */ - -return array( - 'class' => 'Aws\Common\Aws', - 'services' => array( - - 'default_settings' => array( - 'params' => array() - ), - - 'autoscaling' => array( - 'alias' => 'AutoScaling', - 'extends' => 'default_settings', - 'class' => 'Aws\AutoScaling\AutoScalingClient' - ), - - 'cloudformation' => array( - 'alias' => 'CloudFormation', - 'extends' => 'default_settings', - 'class' => 'Aws\CloudFormation\CloudFormationClient' - ), - - 'cloudfront' => array( - 'alias' => 'CloudFront', - 'extends' => 'default_settings', - 'class' => 'Aws\CloudFront\CloudFrontClient' - ), - - 'cloudfront_20120505' => array( - 'extends' => 'cloudfront', - 'params' => array( - 'version' => '2012-05-05' - ) - ), - - 'cloudsearch' => array( - 'alias' => 'CloudSearch', - 'extends' => 'default_settings', - 'class' => 'Aws\CloudSearch\CloudSearchClient' - ), - - 'cloudsearch_20110201' => array( - 'extends' => 'cloudsearch', - 'params' => array( - 'version' => '2011-02-01' - ) - ), - - 'cloudsearchdomain' => array( - 'alias' => 'CloudSearchDomain', - 'extends' => 'default_settings', - 'class' => 'Aws\CloudSearchDomain\CloudSearchDomainClient' - ), - - 'cloudtrail' => array( - 'alias' => 'CloudTrail', - 'extends' => 'default_settings', - 'class' => 'Aws\CloudTrail\CloudTrailClient' - ), - - 'cloudwatch' => array( - 'alias' => 'CloudWatch', - 'extends' => 'default_settings', - 'class' => 'Aws\CloudWatch\CloudWatchClient' - ), - - 'cloudwatchlogs' => array( - 'alias' => 'CloudWatchLogs', - 'extends' => 'default_settings', - 'class' => 'Aws\CloudWatchLogs\CloudWatchLogsClient' - ), - - 'cognito-identity' => array( - 'alias' => 'CognitoIdentity', - 'extends' => 'default_settings', - 'class' => 'Aws\CognitoIdentity\CognitoIdentityClient' - ), - - 'cognitoidentity' => array('extends' => 'cognito-identity'), - - 'cognito-sync' => array( - 'alias' => 'CognitoSync', - 'extends' => 'default_settings', - 'class' => 'Aws\CognitoSync\CognitoSyncClient' - ), - - 'cognitosync' => array('extends' => 'cognito-sync'), - - 'codedeploy' => array( - 'alias' => 'CodeDeploy', - 'extends' => 'default_settings', - 'class' => 'Aws\CodeDeploy\CodeDeployClient' - ), - - 'config' => array( - 'alias' => 'ConfigService', - 'extends' => 'default_settings', - 'class' => 'Aws\ConfigService\ConfigServiceClient' - ), - - 'datapipeline' => array( - 'alias' => 'DataPipeline', - 'extends' => 'default_settings', - 'class' => 'Aws\DataPipeline\DataPipelineClient' - ), - - 'directconnect' => array( - 'alias' => 'DirectConnect', - 'extends' => 'default_settings', - 'class' => 'Aws\DirectConnect\DirectConnectClient' - ), - - 'dynamodb' => array( - 'alias' => 'DynamoDb', - 'extends' => 'default_settings', - 'class' => 'Aws\DynamoDb\DynamoDbClient' - ), - - 'dynamodb_20111205' => array( - 'extends' => 'dynamodb', - 'params' => array( - 'version' => '2011-12-05' - ) - ), - - 'ec2' => array( - 'alias' => 'Ec2', - 'extends' => 'default_settings', - 'class' => 'Aws\Ec2\Ec2Client' - ), - - 'elasticache' => array( - 'alias' => 'ElastiCache', - 'extends' => 'default_settings', - 'class' => 'Aws\ElastiCache\ElastiCacheClient' - ), - - 'elasticbeanstalk' => array( - 'alias' => 'ElasticBeanstalk', - 'extends' => 'default_settings', - 'class' => 'Aws\ElasticBeanstalk\ElasticBeanstalkClient' - ), - - 'elasticloadbalancing' => array( - 'alias' => 'ElasticLoadBalancing', - 'extends' => 'default_settings', - 'class' => 'Aws\ElasticLoadBalancing\ElasticLoadBalancingClient' - ), - - 'elastictranscoder' => array( - 'alias' => 'ElasticTranscoder', - 'extends' => 'default_settings', - 'class' => 'Aws\ElasticTranscoder\ElasticTranscoderClient' - ), - - 'emr' => array( - 'alias' => 'Emr', - 'extends' => 'default_settings', - 'class' => 'Aws\Emr\EmrClient' - ), - - 'glacier' => array( - 'alias' => 'Glacier', - 'extends' => 'default_settings', - 'class' => 'Aws\Glacier\GlacierClient' - ), - - 'kinesis' => array( - 'alias' => 'Kinesis', - 'extends' => 'default_settings', - 'class' => 'Aws\Kinesis\KinesisClient' - ), - - 'kms' => array( - 'alias' => 'Kms', - 'extends' => 'default_settings', - 'class' => 'Aws\Kms\KmsClient' - ), - - 'lambda' => array( - 'alias' => 'Lambda', - 'extends' => 'default_settings', - 'class' => 'Aws\Lambda\LambdaClient' - ), - - 'iam' => array( - 'alias' => 'Iam', - 'extends' => 'default_settings', - 'class' => 'Aws\Iam\IamClient' - ), - - 'importexport' => array( - 'alias' => 'ImportExport', - 'extends' => 'default_settings', - 'class' => 'Aws\ImportExport\ImportExportClient' - ), - - 'opsworks' => array( - 'alias' => 'OpsWorks', - 'extends' => 'default_settings', - 'class' => 'Aws\OpsWorks\OpsWorksClient' - ), - - 'rds' => array( - 'alias' => 'Rds', - 'extends' => 'default_settings', - 'class' => 'Aws\Rds\RdsClient' - ), - - 'redshift' => array( - 'alias' => 'Redshift', - 'extends' => 'default_settings', - 'class' => 'Aws\Redshift\RedshiftClient' - ), - - 'route53' => array( - 'alias' => 'Route53', - 'extends' => 'default_settings', - 'class' => 'Aws\Route53\Route53Client' - ), - - 'route53domains' => array( - 'alias' => 'Route53Domains', - 'extends' => 'default_settings', - 'class' => 'Aws\Route53Domains\Route53DomainsClient' - ), - - 's3' => array( - 'alias' => 'S3', - 'extends' => 'default_settings', - 'class' => 'Aws\S3\S3Client' - ), - - 'sdb' => array( - 'alias' => 'SimpleDb', - 'extends' => 'default_settings', - 'class' => 'Aws\SimpleDb\SimpleDbClient' - ), - - 'ses' => array( - 'alias' => 'Ses', - 'extends' => 'default_settings', - 'class' => 'Aws\Ses\SesClient' - ), - - 'sns' => array( - 'alias' => 'Sns', - 'extends' => 'default_settings', - 'class' => 'Aws\Sns\SnsClient' - ), - - 'sqs' => array( - 'alias' => 'Sqs', - 'extends' => 'default_settings', - 'class' => 'Aws\Sqs\SqsClient' - ), - - 'storagegateway' => array( - 'alias' => 'StorageGateway', - 'extends' => 'default_settings', - 'class' => 'Aws\StorageGateway\StorageGatewayClient' - ), - - 'sts' => array( - 'alias' => 'Sts', - 'extends' => 'default_settings', - 'class' => 'Aws\Sts\StsClient' - ), - - 'support' => array( - 'alias' => 'Support', - 'extends' => 'default_settings', - 'class' => 'Aws\Support\SupportClient' - ), - - 'swf' => array( - 'alias' => 'Swf', - 'extends' => 'default_settings', - 'class' => 'Aws\Swf\SwfClient' - ), - ) -); diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Resources/public-endpoints.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Resources/public-endpoints.php deleted file mode 100644 index f24f3404f21..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Resources/public-endpoints.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -return array( - 'version' => 2, - 'endpoints' => array( - '*/*' => array( - 'endpoint' => '{service}.{region}.amazonaws.com' - ), - 'cn-north-1/*' => array( - 'endpoint' => '{service}.{region}.amazonaws.com.cn', - 'signatureVersion' => 'v4' - ), - 'us-gov-west-1/iam' => array( - 'endpoint' => 'iam.us-gov.amazonaws.com' - ), - 'us-gov-west-1/sts' => array( - 'endpoint' => 'sts.us-gov.amazonaws.com' - ), - 'us-gov-west-1/s3' => array( - 'endpoint' => 's3-{region}.amazonaws.com' - ), - '*/cloudfront' => array( - 'endpoint' => 'cloudfront.amazonaws.com' - ), - '*/iam' => array( - 'endpoint' => 'iam.amazonaws.com' - ), - '*/importexport' => array( - 'endpoint' => 'importexport.amazonaws.com' - ), - '*/route53' => array( - 'endpoint' => 'route53.amazonaws.com' - ), - '*/sts' => array( - 'endpoint' => 'sts.amazonaws.com' - ), - 'us-east-1/sdb' => array( - 'endpoint' => 'sdb.amazonaws.com' - ), - 'us-east-1/s3' => array( - 'endpoint' => 's3.amazonaws.com' - ), - 'us-west-1/s3' => array( - 'endpoint' => 's3-{region}.amazonaws.com' - ), - 'us-west-2/s3' => array( - 'endpoint' => 's3-{region}.amazonaws.com' - ), - 'eu-west-1/s3' => array( - 'endpoint' => 's3-{region}.amazonaws.com' - ), - 'ap-southeast-1/s3' => array( - 'endpoint' => 's3-{region}.amazonaws.com' - ), - 'ap-southeast-2/s3' => array( - 'endpoint' => 's3-{region}.amazonaws.com' - ), - 'ap-northeast-1/s3' => array( - 'endpoint' => 's3-{region}.amazonaws.com' - ), - 'sa-east-1/s3' => array( - 'endpoint' => 's3-{region}.amazonaws.com' - ) - ) -); diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Resources/sdk1-config.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Resources/sdk1-config.php deleted file mode 100644 index a5121ab4900..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Resources/sdk1-config.php +++ /dev/null @@ -1,138 +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. - */ - -return array( - 'includes' => array('_aws'), - 'services' => array( - - 'sdk1_settings' => array( - 'extends' => 'default_settings', - 'params' => array( - 'certificate_authority' => false - ) - ), - - 'v1.autoscaling' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonAS' - ), - - 'v1.cloudformation' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonCloudFormation' - ), - - 'v1.cloudfront' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonCloudFront' - ), - - 'v1.cloudsearch' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonCloudSearch' - ), - - 'v1.cloudwatch' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonCloudWatch' - ), - - 'v1.dynamodb' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonDynamoDB' - ), - - 'v1.ec2' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonEC2' - ), - - 'v1.elasticache' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonElastiCache' - ), - - 'v1.elasticbeanstalk' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonElasticBeanstalk' - ), - - 'v1.elb' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonELB' - ), - - 'v1.emr' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonEMR' - ), - - 'v1.iam' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonIAM' - ), - - 'v1.importexport' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonImportExport' - ), - - 'v1.rds' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonRDS' - ), - - 'v1.s3' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonS3' - ), - - 'v1.sdb' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonSDB' - ), - - 'v1.ses' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonSES' - ), - - 'v1.sns' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonSNS' - ), - - 'v1.sqs' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonSQS' - ), - - 'v1.storagegateway' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonStorageGateway' - ), - - 'v1.sts' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonSTS' - ), - - 'v1.swf' => array( - 'extends' => 'sdk1_settings', - 'class' => 'AmazonSWF' - ) - ) -); diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/RulesEndpointProvider.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/RulesEndpointProvider.php deleted file mode 100644 index ec57cb862ca..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/RulesEndpointProvider.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -namespace Aws\Common; - -/** - * Provides endpoints based on a rules configuration file. - */ -class RulesEndpointProvider -{ - /** @var array */ - private $patterns; - - /** - * @param array $patterns Hash of endpoint patterns mapping to endpoint - * configurations. - */ - public function __construct(array $patterns) - { - $this->patterns = $patterns; - } - - /** - * Creates and returns the default RulesEndpointProvider based on the - * public rule sets. - * - * @return self - */ - public static function fromDefaults() - { - return new self(require __DIR__ . '/Resources/public-endpoints.php'); - } - - public function __invoke(array $args = array()) - { - if (!isset($args['service'])) { - throw new \InvalidArgumentException('Requires a "service" value'); - } - - if (!isset($args['region'])) { - throw new \InvalidArgumentException('Requires a "region" value'); - } - - foreach ($this->getKeys($args['region'], $args['service']) as $key) { - if (isset($this->patterns['endpoints'][$key])) { - return $this->expand($this->patterns['endpoints'][$key], $args); - } - } - - throw new \RuntimeException('Could not resolve endpoint'); - } - - private function expand(array $config, array $args) - { - $scheme = isset($args['scheme']) ? $args['scheme'] : 'https'; - $config['endpoint'] = $scheme . '://' . str_replace( - array('{service}', '{region}'), - array($args['service'], $args['region']), - $config['endpoint'] - ); - - return $config; - } - - private function getKeys($region, $service) - { - return array("$region/$service", "$region/*", "*/$service", "*/*"); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/AbstractSignature.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/AbstractSignature.php deleted file mode 100644 index 2d25d873c64..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/AbstractSignature.php +++ /dev/null @@ -1,44 +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\Common\Signature; - -use Aws\Common\Credentials\CredentialsInterface; -use Guzzle\Http\Message\RequestInterface; - -abstract class AbstractSignature implements SignatureInterface -{ - /** - * Provides the timestamp used for the class (used for mocking PHP's time() function) - * - * @return int - */ - protected function getTimestamp() - { - return time(); - } - - /** - * @codeCoverageIgnore - */ - public function createPresignedUrl( - RequestInterface $request, - CredentialsInterface $credentials, - $expires - ) { - throw new \BadMethodCallException(__METHOD__ . ' not implemented'); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/EndpointSignatureInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/EndpointSignatureInterface.php deleted file mode 100644 index a71cb73ceb4..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/EndpointSignatureInterface.php +++ /dev/null @@ -1,42 +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\Common\Signature; - -/** - * Interface for signatures that use specific region and service names when - * signing requests. - */ -interface EndpointSignatureInterface extends SignatureInterface -{ - /** - * Set the service name instead of inferring it from a request URL - * - * @param string $service Name of the service used when signing - * - * @return self - */ - public function setServiceName($service); - - /** - * Set the region name instead of inferring it from a request URL - * - * @param string $region Name of the region used when signing - * - * @return self - */ - public function setRegionName($region); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureInterface.php deleted file mode 100644 index e3536ba46a6..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureInterface.php +++ /dev/null @@ -1,52 +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\Common\Signature; - -use Aws\Common\Credentials\CredentialsInterface; -use Guzzle\Http\Message\RequestInterface; - -/** - * Interface used to provide interchangeable strategies for signing requests - * using the various AWS signature protocols. - */ -interface SignatureInterface -{ - /** - * Signs the specified request with an AWS signing protocol by using the - * provided AWS account credentials and adding the required headers to the - * request. - * - * @param RequestInterface $request Request to add a signature to - * @param CredentialsInterface $credentials Signing credentials - */ - public function signRequest(RequestInterface $request, CredentialsInterface $credentials); - - /** - * Create a pre-signed URL - * - * @param RequestInterface $request Request to sign - * @param CredentialsInterface $credentials Credentials used to sign - * @param int|string|\DateTime $expires The time at which the URL should expire. This can be a Unix timestamp, a - * PHP DateTime object, or a string that can be evaluated by strtotime - * @return string - */ - public function createPresignedUrl( - RequestInterface $request, - CredentialsInterface $credentials, - $expires - ); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureListener.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureListener.php deleted file mode 100644 index d24d2520000..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureListener.php +++ /dev/null @@ -1,80 +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\Common\Signature; - -use Aws\Common\Credentials\CredentialsInterface; -use Guzzle\Common\Event; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Listener used to sign requests before they are sent over the wire - */ -class SignatureListener implements EventSubscriberInterface -{ - /** - * @var CredentialsInterface - */ - protected $credentials; - - /** - * @var SignatureInterface - */ - protected $signature; - - /** - * Construct a new request signing plugin - * - * @param CredentialsInterface $credentials Credentials used to sign requests - * @param SignatureInterface $signature Signature implementation - */ - public function __construct(CredentialsInterface $credentials, SignatureInterface $signature) - { - $this->credentials = $credentials; - $this->signature = $signature; - } - - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() - { - return array( - 'request.before_send' => array('onRequestBeforeSend', -255), - 'client.credentials_changed' => array('onCredentialsChanged') - ); - } - - /** - * Updates the listener with new credentials if the client is updated - * - * @param Event $event Event emitted - */ - public function onCredentialsChanged(Event $event) - { - $this->credentials = $event['credentials']; - } - - /** - * Signs requests before they are sent - * - * @param Event $event Event emitted - */ - public function onRequestBeforeSend(Event $event) - { - $this->signature->signRequest($event['request'], $this->credentials); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureV2.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureV2.php deleted file mode 100644 index c900287643d..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureV2.php +++ /dev/null @@ -1,109 +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\Common\Signature; - -use Aws\Common\Credentials\CredentialsInterface; -use Guzzle\Http\Message\RequestInterface; - -/** - * Implementation of Signature Version 2 - * @link http://aws.amazon.com/articles/1928 - */ -class SignatureV2 extends AbstractSignature -{ - public function signRequest(RequestInterface $request, CredentialsInterface $credentials) - { - // refresh the cached timestamp - $timestamp = $this->getTimestamp(true); - - // set values we need in CanonicalizedParameterString - $this->addParameter($request, 'Timestamp', gmdate('c', $timestamp)); - $this->addParameter($request, 'SignatureVersion', '2'); - $this->addParameter($request, 'SignatureMethod', 'HmacSHA256'); - $this->addParameter($request, 'AWSAccessKeyId', $credentials->getAccessKeyId()); - - if ($token = $credentials->getSecurityToken()) { - $this->addParameter($request, 'SecurityToken', $token); - } - - // Get the path and ensure it's absolute - $path = '/' . ltrim($request->getUrl(true)->normalizePath()->getPath(), '/'); - - // build string to sign - $sign = $request->getMethod() . "\n" - . $request->getHost() . "\n" - . $path . "\n" - . $this->getCanonicalizedParameterString($request); - - // Add the string to sign to the request for debugging purposes - $request->getParams()->set('aws.string_to_sign', $sign); - - $signature = base64_encode( - hash_hmac( - 'sha256', - $sign, - $credentials->getSecretKey(), - true - ) - ); - - $this->addParameter($request, 'Signature', $signature); - } - - /** - * Add a parameter key and value to the request according to type - * - * @param RequestInterface $request The request - * @param string $key The name of the parameter - * @param string $value The value of the parameter - */ - public function addParameter(RequestInterface $request, $key, $value) - { - if ($request->getMethod() == 'POST') { - $request->setPostField($key, $value); - } else { - $request->getQuery()->set($key, $value); - } - } - - /** - * Get the canonicalized query/parameter string for a request - * - * @param RequestInterface $request Request used to build canonicalized string - * - * @return string - */ - private function getCanonicalizedParameterString(RequestInterface $request) - { - if ($request->getMethod() == 'POST') { - $params = $request->getPostFields()->toArray(); - } else { - $params = $request->getQuery()->toArray(); - } - - // Don't resign a previous signature value - unset($params['Signature']); - uksort($params, 'strcmp'); - - $str = ''; - foreach ($params as $key => $val) { - $str .= rawurlencode($key) . '=' . rawurlencode($val) . '&'; - } - - return substr($str, 0, -1); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureV3Https.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureV3Https.php deleted file mode 100644 index be0514e2729..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureV3Https.php +++ /dev/null @@ -1,52 +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\Common\Signature; - -use Aws\Common\Credentials\CredentialsInterface; -use Aws\Common\Enum\DateFormat; -use Guzzle\Http\Message\RequestInterface; - -/** - * Implementation of Signature Version 3 HTTPS - * @link http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/RESTAuthentication.html - */ -class SignatureV3Https extends AbstractSignature -{ - public function signRequest(RequestInterface $request, CredentialsInterface $credentials) - { - // Add a date header if one is not set - if (!$request->hasHeader('date') && !$request->hasHeader('x-amz-date')) { - $request->setHeader('Date', gmdate(DateFormat::RFC1123, $this->getTimestamp())); - } - - // Add the security token if one is present - if ($credentials->getSecurityToken()) { - $request->setHeader('x-amz-security-token', $credentials->getSecurityToken()); - } - - // Determine the string to sign - $stringToSign = (string) ($request->getHeader('Date') ?: $request->getHeader('x-amz-date')); - $request->getParams()->set('aws.string_to_sign', $stringToSign); - - // Calculate the signature - $signature = base64_encode(hash_hmac('sha256', $stringToSign, $credentials->getSecretKey(), true)); - - // Add the authorization header to the request - $headerFormat = 'AWS3-HTTPS AWSAccessKeyId=%s,Algorithm=HmacSHA256,Signature=%s'; - $request->setHeader('X-Amzn-Authorization', sprintf($headerFormat, $credentials->getAccessKeyId(), $signature)); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureV4.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureV4.php deleted file mode 100644 index 38b60b4594b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Signature/SignatureV4.php +++ /dev/null @@ -1,470 +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\Common\Signature; - -use Aws\Common\Credentials\CredentialsInterface; -use Aws\Common\Enum\DateFormat; -use Aws\Common\HostNameUtils; -use Guzzle\Http\Message\EntityEnclosingRequestInterface; -use Guzzle\Http\Message\RequestFactory; -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\QueryString; -use Guzzle\Http\Url; - -/** - * Signature Version 4 - * @link http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html - */ -class SignatureV4 extends AbstractSignature implements EndpointSignatureInterface -{ - /** @var string Cache of the default empty entity-body payload */ - const DEFAULT_PAYLOAD = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'; - - /** @var string Explicitly set service name */ - protected $serviceName; - - /** @var string Explicitly set region name */ - protected $regionName; - - /** @var int Maximum number of hashes to cache */ - protected $maxCacheSize = 50; - - /** @var array Cache of previously signed values */ - protected $hashCache = array(); - - /** @var int Size of the hash cache */ - protected $cacheSize = 0; - - /** - * @param string $serviceName Bind the signing to a particular service name - * @param string $regionName Bind the signing to a particular region name - */ - public function __construct($serviceName = null, $regionName = null) - { - $this->serviceName = $serviceName; - $this->regionName = $regionName; - } - - /** - * Set the service name instead of inferring it from a request URL - * - * @param string $service Name of the service used when signing - * - * @return self - */ - public function setServiceName($service) - { - $this->serviceName = $service; - - return $this; - } - - /** - * Set the region name instead of inferring it from a request URL - * - * @param string $region Name of the region used when signing - * - * @return self - */ - public function setRegionName($region) - { - $this->regionName = $region; - - return $this; - } - - /** - * Set the maximum number of computed hashes to cache - * - * @param int $maxCacheSize Maximum number of hashes to cache - * - * @return self - */ - public function setMaxCacheSize($maxCacheSize) - { - $this->maxCacheSize = $maxCacheSize; - - return $this; - } - - public function signRequest(RequestInterface $request, CredentialsInterface $credentials) - { - $timestamp = $this->getTimestamp(); - $longDate = gmdate(DateFormat::ISO8601, $timestamp); - $shortDate = substr($longDate, 0, 8); - - // Remove any previously set Authorization headers so that retries work - $request->removeHeader('Authorization'); - - // Requires a x-amz-date header or Date - if ($request->hasHeader('x-amz-date') || !$request->hasHeader('Date')) { - $request->setHeader('x-amz-date', $longDate); - } else { - $request->setHeader('Date', gmdate(DateFormat::RFC1123, $timestamp)); - } - - // Add the security token if one is present - if ($credentials->getSecurityToken()) { - $request->setHeader('x-amz-security-token', $credentials->getSecurityToken()); - } - - // Parse the service and region or use one that is explicitly set - $region = $this->regionName; - $service = $this->serviceName; - if (!$region || !$service) { - $url = Url::factory($request->getUrl()); - $region = $region ?: HostNameUtils::parseRegionName($url); - $service = $service ?: HostNameUtils::parseServiceName($url); - } - - $credentialScope = $this->createScope($shortDate, $region, $service); - $payload = $this->getPayload($request); - $signingContext = $this->createSigningContext($request, $payload); - $signingContext['string_to_sign'] = $this->createStringToSign( - $longDate, - $credentialScope, - $signingContext['canonical_request'] - ); - - // Calculate the signing key using a series of derived keys - $signingKey = $this->getSigningKey($shortDate, $region, $service, $credentials->getSecretKey()); - $signature = hash_hmac('sha256', $signingContext['string_to_sign'], $signingKey); - - $request->setHeader('Authorization', "AWS4-HMAC-SHA256 " - . "Credential={$credentials->getAccessKeyId()}/{$credentialScope}, " - . "SignedHeaders={$signingContext['signed_headers']}, Signature={$signature}"); - - // Add debug information to the request - $request->getParams()->set('aws.signature', $signingContext); - } - - public function createPresignedUrl( - RequestInterface $request, - CredentialsInterface $credentials, - $expires - ) { - $request = $this->createPresignedRequest($request, $credentials); - $query = $request->getQuery(); - $httpDate = gmdate(DateFormat::ISO8601, $this->getTimestamp()); - $shortDate = substr($httpDate, 0, 8); - $scope = $this->createScope( - $shortDate, - $this->regionName, - $this->serviceName - ); - $this->addQueryValues($scope, $request, $credentials, $expires); - $payload = $this->getPresignedPayload($request); - $context = $this->createSigningContext($request, $payload); - $stringToSign = $this->createStringToSign( - $httpDate, - $scope, - $context['canonical_request'] - ); - $key = $this->getSigningKey( - $shortDate, - $this->regionName, - $this->serviceName, - $credentials->getSecretKey() - ); - $query['X-Amz-Signature'] = hash_hmac('sha256', $stringToSign, $key); - - return $request->getUrl(); - } - - /** - * Converts a POST request to a GET request by moving POST fields into the - * query string. - * - * Useful for pre-signing query protocol requests. - * - * @param EntityEnclosingRequestInterface $request Request to clone - * - * @return RequestInterface - * @throws \InvalidArgumentException if the method is not POST - */ - public static function convertPostToGet(EntityEnclosingRequestInterface $request) - { - if ($request->getMethod() !== 'POST') { - throw new \InvalidArgumentException('Expected a POST request but ' - . 'received a ' . $request->getMethod() . ' request.'); - } - - $cloned = RequestFactory::getInstance() - ->cloneRequestWithMethod($request, 'GET'); - - // Move POST fields to the query if they are present - foreach ($request->getPostFields() as $name => $value) { - $cloned->getQuery()->set($name, $value); - } - - return $cloned; - } - - /** - * Get the payload part of a signature from a request. - * - * @param RequestInterface $request - * - * @return string - */ - protected function getPayload(RequestInterface $request) - { - // Calculate the request signature payload - if ($request->hasHeader('x-amz-content-sha256')) { - // Handle streaming operations (e.g. Glacier.UploadArchive) - return (string) $request->getHeader('x-amz-content-sha256'); - } - - if ($request instanceof EntityEnclosingRequestInterface) { - return hash( - 'sha256', - $request->getMethod() == 'POST' && count($request->getPostFields()) - ? (string) $request->getPostFields() - : (string) $request->getBody() - ); - } - - return self::DEFAULT_PAYLOAD; - } - - /** - * Get the payload of a request for use with pre-signed URLs. - * - * @param RequestInterface $request - * - * @return string - */ - protected function getPresignedPayload(RequestInterface $request) - { - return $this->getPayload($request); - } - - protected function createCanonicalizedPath(RequestInterface $request) - { - $doubleEncoded = rawurlencode(ltrim($request->getPath(), '/')); - - return '/' . str_replace('%2F', '/', $doubleEncoded); - } - - private function createStringToSign($longDate, $credentialScope, $creq) - { - return "AWS4-HMAC-SHA256\n{$longDate}\n{$credentialScope}\n" - . hash('sha256', $creq); - } - - private function createPresignedRequest( - RequestInterface $request, - CredentialsInterface $credentials - ) { - $sr = RequestFactory::getInstance()->cloneRequestWithMethod($request, 'GET'); - - // Move POST fields to the query if they are present - if ($request instanceof EntityEnclosingRequestInterface) { - foreach ($request->getPostFields() as $name => $value) { - $sr->getQuery()->set($name, $value); - } - } - - // Make sure to handle temporary credentials - if ($token = $credentials->getSecurityToken()) { - $sr->setHeader('X-Amz-Security-Token', $token); - $sr->getQuery()->set('X-Amz-Security-Token', $token); - } - - $this->moveHeadersToQuery($sr); - - return $sr; - } - - /** - * Create the canonical representation of a request - * - * @param RequestInterface $request Request to canonicalize - * @param string $payload Request payload (typically the value - * of the x-amz-content-sha256 header. - * - * @return array Returns an array of context information including: - * - canonical_request - * - signed_headers - */ - private function createSigningContext(RequestInterface $request, $payload) - { - $signable = array( - 'host' => true, - 'date' => true, - 'content-md5' => true - ); - - // Normalize the path as required by SigV4 and ensure it's absolute - $canon = $request->getMethod() . "\n" - . $this->createCanonicalizedPath($request) . "\n" - . $this->getCanonicalizedQueryString($request) . "\n"; - - $canonHeaders = array(); - - foreach ($request->getHeaders()->getAll() as $key => $values) { - $key = strtolower($key); - if (isset($signable[$key]) || substr($key, 0, 6) === 'x-amz-') { - $values = $values->toArray(); - if (count($values) == 1) { - $values = $values[0]; - } else { - sort($values); - $values = implode(',', $values); - } - $canonHeaders[$key] = $key . ':' . preg_replace('/\s+/', ' ', $values); - } - } - - ksort($canonHeaders); - $signedHeadersString = implode(';', array_keys($canonHeaders)); - $canon .= implode("\n", $canonHeaders) . "\n\n" - . $signedHeadersString . "\n" - . $payload; - - return array( - 'canonical_request' => $canon, - 'signed_headers' => $signedHeadersString - ); - } - - /** - * Get a hash for a specific key and value. If the hash was previously - * cached, return it - * - * @param string $shortDate Short date - * @param string $region Region name - * @param string $service Service name - * @param string $secretKey Secret Access Key - * - * @return string - */ - private function getSigningKey($shortDate, $region, $service, $secretKey) - { - $cacheKey = $shortDate . '_' . $region . '_' . $service . '_' . $secretKey; - - // Retrieve the hash form the cache or create it and add it to the cache - if (!isset($this->hashCache[$cacheKey])) { - // When the cache size reaches the max, then just clear the cache - if (++$this->cacheSize > $this->maxCacheSize) { - $this->hashCache = array(); - $this->cacheSize = 0; - } - $dateKey = hash_hmac('sha256', $shortDate, 'AWS4' . $secretKey, true); - $regionKey = hash_hmac('sha256', $region, $dateKey, true); - $serviceKey = hash_hmac('sha256', $service, $regionKey, true); - $this->hashCache[$cacheKey] = hash_hmac('sha256', 'aws4_request', $serviceKey, true); - } - - return $this->hashCache[$cacheKey]; - } - - /** - * Get the canonicalized query string for a request - * - * @param RequestInterface $request - * @return string - */ - private function getCanonicalizedQueryString(RequestInterface $request) - { - $queryParams = $request->getQuery()->getAll(); - unset($queryParams['X-Amz-Signature']); - if (empty($queryParams)) { - return ''; - } - - $qs = ''; - ksort($queryParams); - foreach ($queryParams as $key => $values) { - if (is_array($values)) { - sort($values); - } elseif ($values === 0) { - $values = array('0'); - } elseif (!$values) { - $values = array(''); - } - - foreach ((array) $values as $value) { - if ($value === QueryString::BLANK) { - $value = ''; - } - $qs .= rawurlencode($key) . '=' . rawurlencode($value) . '&'; - } - } - - return substr($qs, 0, -1); - } - - private function convertExpires($expires) - { - if ($expires instanceof \DateTime) { - $expires = $expires->getTimestamp(); - } elseif (!is_numeric($expires)) { - $expires = strtotime($expires); - } - - $duration = $expires - time(); - - // Ensure that the duration of the signature is not longer than a week - if ($duration > 604800) { - throw new \InvalidArgumentException('The expiration date of a ' - . 'signature version 4 presigned URL must be less than one ' - . 'week'); - } - - return $duration; - } - - private function createScope($shortDate, $region, $service) - { - return $shortDate - . '/' . $region - . '/' . $service - . '/aws4_request'; - } - - private function addQueryValues( - $scope, - RequestInterface $request, - CredentialsInterface $credentials, - $expires - ) { - $credential = $credentials->getAccessKeyId() . '/' . $scope; - - // Set query params required for pre-signed URLs - $request->getQuery() - ->set('X-Amz-Algorithm', 'AWS4-HMAC-SHA256') - ->set('X-Amz-Credential', $credential) - ->set('X-Amz-Date', gmdate('Ymd\THis\Z', $this->getTimestamp())) - ->set('X-Amz-SignedHeaders', 'Host') - ->set('X-Amz-Expires', $this->convertExpires($expires)); - } - - private function moveHeadersToQuery(RequestInterface $request) - { - $query = $request->getQuery(); - - foreach ($request->getHeaders() as $name => $header) { - if (substr($name, 0, 5) == 'x-amz') { - $query[$header->getName()] = (string) $header; - } - if ($name !== 'host') { - $request->removeHeader($name); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/AbstractResourceWaiter.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/AbstractResourceWaiter.php deleted file mode 100644 index 53348486385..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/AbstractResourceWaiter.php +++ /dev/null @@ -1,53 +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\Common\Waiter; - -use Aws\Common\Client\AwsClientInterface; -use Aws\Common\Exception\RuntimeException; - -/** - * Abstract waiter implementation used to wait on resources - */ -abstract class AbstractResourceWaiter extends AbstractWaiter implements ResourceWaiterInterface -{ - /** - * @var AwsClientInterface - */ - protected $client; - - /** - * {@inheritdoc} - */ - public function setClient(AwsClientInterface $client) - { - $this->client = $client; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function wait() - { - if (!$this->client) { - throw new RuntimeException('No client has been specified on the waiter'); - } - - parent::wait(); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/AbstractWaiter.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/AbstractWaiter.php deleted file mode 100644 index 09dbea1fc3c..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/AbstractWaiter.php +++ /dev/null @@ -1,146 +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\Common\Waiter; - -use Aws\Common\Exception\RuntimeException; -use Guzzle\Common\AbstractHasDispatcher; - -/** - * Abstract wait implementation - */ -abstract class AbstractWaiter extends AbstractHasDispatcher implements WaiterInterface -{ - protected $attempts = 0; - protected $config = array(); - - /** - * {@inheritdoc} - */ - public static function getAllEvents() - { - return array( - // About to check if the waiter needs to wait - 'waiter.before_attempt', - // About to sleep - 'waiter.before_wait', - ); - } - - /** - * The max attempts allowed by the waiter - * - * @return int - */ - public function getMaxAttempts() - { - return isset($this->config[self::MAX_ATTEMPTS]) ? $this->config[self::MAX_ATTEMPTS] : 10; - } - - /** - * Get the amount of time in seconds to delay between attempts - * - * @return int - */ - public function getInterval() - { - return isset($this->config[self::INTERVAL]) ? $this->config[self::INTERVAL] : 0; - } - - /** - * {@inheritdoc} - */ - public function setMaxAttempts($maxAttempts) - { - $this->config[self::MAX_ATTEMPTS] = $maxAttempts; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function setInterval($interval) - { - $this->config[self::INTERVAL] = $interval; - - return $this; - } - - /** - * Set config options associated with the waiter - * - * @param array $config Options to set - * - * @return self - */ - public function setConfig(array $config) - { - if (isset($config['waiter.before_attempt'])) { - $this->getEventDispatcher()->addListener('waiter.before_attempt', $config['waiter.before_attempt']); - unset($config['waiter.before_attempt']); - } - - if (isset($config['waiter.before_wait'])) { - $this->getEventDispatcher()->addListener('waiter.before_wait', $config['waiter.before_wait']); - unset($config['waiter.before_wait']); - } - - $this->config = $config; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function wait() - { - $this->attempts = 0; - - do { - $this->dispatch('waiter.before_attempt', array( - 'waiter' => $this, - 'config' => $this->config, - )); - - if ($this->doWait()) { - break; - } - - if (++$this->attempts >= $this->getMaxAttempts()) { - throw new RuntimeException('Wait method never resolved to true after ' . $this->attempts . ' attempts'); - } - - $this->dispatch('waiter.before_wait', array( - 'waiter' => $this, - 'config' => $this->config, - )); - - if ($this->getInterval()) { - usleep($this->getInterval() * 1000000); - } - - } while (1); - } - - /** - * Method to implement in subclasses - * - * @return bool Return true when successful, false on failure - */ - abstract protected function doWait(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/CallableWaiter.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/CallableWaiter.php deleted file mode 100644 index a205e061751..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/CallableWaiter.php +++ /dev/null @@ -1,82 +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\Common\Waiter; - -use Aws\Common\Exception\InvalidArgumentException; -use Aws\Common\Exception\RuntimeException; - -/** - * Callable wait implementation - */ -class CallableWaiter extends AbstractWaiter -{ - /** - * @var callable Callable function - */ - protected $callable; - - /** - * @var array Additional context for the callable function - */ - protected $context = array(); - - /** - * Set the callable function to call in each wait attempt - * - * @param callable $callable Callable function - * - * @return self - * @throws InvalidArgumentException when the method is not callable - */ - public function setCallable($callable) - { - if (!is_callable($callable)) { - throw new InvalidArgumentException('Value is not callable'); - } - - $this->callable = $callable; - - return $this; - } - - /** - * Set additional context for the callable function. This data will be passed into the callable function as the - * second argument - * - * @param array $context Additional context - * - * @return self - */ - public function setContext(array $context) - { - $this->context = $context; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function doWait() - { - if (!$this->callable) { - throw new RuntimeException('No callable was specified for the wait method'); - } - - return call_user_func($this->callable, $this->attempts, $this->context); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/CompositeWaiterFactory.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/CompositeWaiterFactory.php deleted file mode 100644 index 5278e49f29a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/CompositeWaiterFactory.php +++ /dev/null @@ -1,90 +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\Common\Waiter; - -use Aws\Common\Exception\InvalidArgumentException; - -/** - * Factory that utilizes multiple factories for creating waiters - */ -class CompositeWaiterFactory implements WaiterFactoryInterface -{ - /** - * @var array Array of factories - */ - protected $factories; - - /** - * @param array $factories Array of factories used to instantiate waiters - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - /** - * {@inheritdoc} - */ - public function build($waiter) - { - if (!($factory = $this->getFactory($waiter))) { - throw new InvalidArgumentException("Waiter was not found matching {$waiter}."); - } - - return $factory->build($waiter); - } - - /** - * {@inheritdoc} - */ - public function canBuild($waiter) - { - return (bool) $this->getFactory($waiter); - } - - /** - * Add a factory to the composite factory - * - * @param WaiterFactoryInterface $factory Factory to add - * - * @return self - */ - public function addFactory(WaiterFactoryInterface $factory) - { - $this->factories[] = $factory; - - return $this; - } - - /** - * Get the factory that matches the waiter name - * - * @param string $waiter Name of the waiter - * - * @return WaiterFactoryInterface|bool - */ - protected function getFactory($waiter) - { - foreach ($this->factories as $factory) { - if ($factory->canBuild($waiter)) { - return $factory; - } - } - - return false; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/ConfigResourceWaiter.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/ConfigResourceWaiter.php deleted file mode 100644 index 8ef0577da73..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/ConfigResourceWaiter.php +++ /dev/null @@ -1,225 +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\Common\Waiter; - -use Aws\Common\Exception\InvalidArgumentException; -use Aws\Common\Exception\RuntimeException; -use Aws\Common\Exception\ServiceResponseException; -use Guzzle\Service\Resource\Model; -use Guzzle\Service\Exception\ValidationException; - -/** - * Resource waiter driven by configuration options - */ -class ConfigResourceWaiter extends AbstractResourceWaiter -{ - /** - * @var WaiterConfig Waiter configuration - */ - protected $waiterConfig; - - /** - * @param WaiterConfig $waiterConfig Waiter configuration - */ - public function __construct(WaiterConfig $waiterConfig) - { - $this->waiterConfig = $waiterConfig; - $this->setInterval($waiterConfig->get(WaiterConfig::INTERVAL)); - $this->setMaxAttempts($waiterConfig->get(WaiterConfig::MAX_ATTEMPTS)); - } - - /** - * {@inheritdoc} - */ - public function setConfig(array $config) - { - foreach ($config as $key => $value) { - if (substr($key, 0, 7) == 'waiter.') { - $this->waiterConfig->set(substr($key, 7), $value); - } - } - - if (!isset($config[self::INTERVAL])) { - $config[self::INTERVAL] = $this->waiterConfig->get(WaiterConfig::INTERVAL); - } - - if (!isset($config[self::MAX_ATTEMPTS])) { - $config[self::MAX_ATTEMPTS] = $this->waiterConfig->get(WaiterConfig::MAX_ATTEMPTS); - } - - return parent::setConfig($config); - } - - /** - * Get the waiter's configuration data - * - * @return WaiterConfig - */ - public function getWaiterConfig() - { - return $this->waiterConfig; - } - - /** - * {@inheritdoc} - */ - protected function doWait() - { - $params = $this->config; - // remove waiter settings from the operation's input - foreach (array_keys($params) as $key) { - if (substr($key, 0, 7) == 'waiter.') { - unset($params[$key]); - } - } - - $operation = $this->client->getCommand($this->waiterConfig->get(WaiterConfig::OPERATION), $params); - - try { - return $this->checkResult($this->client->execute($operation)); - } catch (ValidationException $e) { - throw new InvalidArgumentException( - $this->waiterConfig->get(WaiterConfig::WAITER_NAME) . ' waiter validation failed: ' . $e->getMessage(), - $e->getCode(), - $e - ); - } catch (ServiceResponseException $e) { - - // Check if this exception satisfies a success or failure acceptor - $transition = $this->checkErrorAcceptor($e); - if (null !== $transition) { - return $transition; - } - - // Check if this exception should be ignored - foreach ((array) $this->waiterConfig->get(WaiterConfig::IGNORE_ERRORS) as $ignore) { - if ($e->getExceptionCode() == $ignore) { - // This exception is ignored, so it counts as a failed attempt rather than a fast-fail - return false; - } - } - - // Allow non-ignore exceptions to bubble through - throw $e; - } - } - - /** - * Check if an exception satisfies a success or failure acceptor - * - * @param ServiceResponseException $e - * - * @return bool|null Returns true for success, false for failure, and null for no transition - */ - protected function checkErrorAcceptor(ServiceResponseException $e) - { - if ($this->waiterConfig->get(WaiterConfig::SUCCESS_TYPE) == 'error') { - if ($e->getExceptionCode() == $this->waiterConfig->get(WaiterConfig::SUCCESS_VALUE)) { - // Mark as a success - return true; - } - } - - // Mark as an attempt - return null; - } - - /** - * Check to see if the response model satisfies a success or failure state - * - * @param Model $result Result model - * - * @return bool - * @throws RuntimeException - */ - protected function checkResult(Model $result) - { - // Check if the result evaluates to true based on the path and output model - if ($this->waiterConfig->get(WaiterConfig::SUCCESS_TYPE) == 'output' && - $this->checkPath( - $result, - $this->waiterConfig->get(WaiterConfig::SUCCESS_PATH), - $this->waiterConfig->get(WaiterConfig::SUCCESS_VALUE) - ) - ) { - return true; - } - - // It did not finish waiting yet. Determine if we need to fail-fast based on the failure acceptor. - if ($this->waiterConfig->get(WaiterConfig::FAILURE_TYPE) == 'output') { - $failureValue = $this->waiterConfig->get(WaiterConfig::FAILURE_VALUE); - if ($failureValue) { - $key = $this->waiterConfig->get(WaiterConfig::FAILURE_PATH); - if ($this->checkPath($result, $key, $failureValue, false)) { - // Determine which of the results triggered the failure - $triggered = array_intersect( - (array) $this->waiterConfig->get(WaiterConfig::FAILURE_VALUE), - array_unique((array) $result->getPath($key)) - ); - // fast fail because the failure case was satisfied - throw new RuntimeException( - 'A resource entered into an invalid state of "' - . implode(', ', $triggered) . '" while waiting with the "' - . $this->waiterConfig->get(WaiterConfig::WAITER_NAME) . '" waiter.' - ); - } - } - } - - return false; - } - - /** - * Check to see if the path of the output key is satisfied by the value - * - * @param Model $model Result model - * @param string $key Key to check - * @param string $checkValue Compare the key to the value - * @param bool $all Set to true to ensure all value match or false to only match one - * - * @return bool - */ - protected function checkPath(Model $model, $key = null, $checkValue = array(), $all = true) - { - // If no key is set, then just assume true because the request succeeded - if (!$key) { - return true; - } - - if (!($result = $model->getPath($key))) { - return false; - } - - $total = $matches = 0; - foreach ((array) $result as $value) { - $total++; - foreach ((array) $checkValue as $check) { - if ($value == $check) { - $matches++; - break; - } - } - } - - // When matching all values, ensure that the match count matches the total count - if ($all && $total != $matches) { - return false; - } - - return $matches > 0; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/ResourceWaiterInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/ResourceWaiterInterface.php deleted file mode 100644 index 07cf41d65fe..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/ResourceWaiterInterface.php +++ /dev/null @@ -1,34 +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\Common\Waiter; - -use Aws\Common\Client\AwsClientInterface; - -/** - * Interface used in conjunction with clients to wait on a resource - */ -interface ResourceWaiterInterface extends WaiterInterface -{ - /** - * Set the client associated with the waiter - * - * @param AwsClientInterface $client Client to use with the waiter - * - * @return self - */ - public function setClient(AwsClientInterface $client); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterClassFactory.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterClassFactory.php deleted file mode 100644 index 43686abd498..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterClassFactory.php +++ /dev/null @@ -1,106 +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\Common\Waiter; - -use Aws\Common\Exception\InvalidArgumentException; -use Guzzle\Inflection\Inflector; -use Guzzle\Inflection\InflectorInterface; - -/** - * Factory for creating {@see WaiterInterface} objects using a convention of - * storing waiter classes in the Waiter folder of a client class namespace using - * a snake_case to CamelCase conversion (e.g. camel_case => CamelCase). - */ -class WaiterClassFactory implements WaiterFactoryInterface -{ - /** - * @var array List of namespaces used to look for classes - */ - protected $namespaces; - - /** - * @var InflectorInterface Inflector used to inflect class names - */ - protected $inflector; - - /** - * @param array|string $namespaces Namespaces of waiter objects - * @param InflectorInterface $inflector Inflector used to resolve class names - */ - public function __construct($namespaces = array(), InflectorInterface $inflector = null) - { - $this->namespaces = (array) $namespaces; - $this->inflector = $inflector ?: Inflector::getDefault(); - } - - /** - * Registers a namespace to check for Waiters - * - * @param string $namespace Namespace which contains Waiter classes - * - * @return self - */ - public function registerNamespace($namespace) - { - array_unshift($this->namespaces, $namespace); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function build($waiter) - { - if (!($className = $this->getClassName($waiter))) { - throw new InvalidArgumentException("Waiter was not found matching {$waiter}."); - } - - return new $className(); - } - - /** - * {@inheritdoc} - */ - public function canBuild($waiter) - { - return $this->getClassName($waiter) !== null; - } - - /** - * Get the name of a waiter class - * - * @param string $waiter Waiter name - * - * @return string|null - */ - protected function getClassName($waiter) - { - $waiterName = $this->inflector->camel($waiter); - - // Determine the name of the class to load - $className = null; - foreach ($this->namespaces as $namespace) { - $potentialClassName = $namespace . '\\' . $waiterName; - if (class_exists($potentialClassName)) { - return $potentialClassName; - } - } - - return null; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterConfig.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterConfig.php deleted file mode 100644 index 7c10f5a9d78..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterConfig.php +++ /dev/null @@ -1,67 +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\Common\Waiter; - -use Guzzle\Common\Collection; - -/** - * Configuration info of a waiter object - */ -class WaiterConfig extends Collection -{ - const WAITER_NAME = 'name'; - const MAX_ATTEMPTS = 'max_attempts'; - const INTERVAL = 'interval'; - const OPERATION = 'operation'; - const IGNORE_ERRORS = 'ignore_errors'; - const DESCRIPTION = 'description'; - const SUCCESS_TYPE = 'success.type'; - const SUCCESS_PATH = 'success.path'; - const SUCCESS_VALUE = 'success.value'; - const FAILURE_TYPE = 'failure.type'; - const FAILURE_PATH = 'failure.path'; - const FAILURE_VALUE = 'failure.value'; - - /** - * @param array $data Array of configuration directives - */ - public function __construct(array $data = array()) - { - $this->data = $data; - $this->extractConfig(); - } - - /** - * Create the command configuration variables - */ - protected function extractConfig() - { - // Populate success.* and failure.* if specified in acceptor.* - foreach ($this->data as $key => $value) { - if (substr($key, 0, 9) == 'acceptor.') { - $name = substr($key, 9); - if (!isset($this->data["success.{$name}"])) { - $this->data["success.{$name}"] = $value; - } - if (!isset($this->data["failure.{$name}"])) { - $this->data["failure.{$name}"] = $value; - } - unset($this->data[$key]); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterConfigFactory.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterConfigFactory.php deleted file mode 100644 index cb921495f99..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterConfigFactory.php +++ /dev/null @@ -1,98 +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\Common\Waiter; - -use Aws\Common\Exception\InvalidArgumentException; -use Guzzle\Inflection\Inflector; -use Guzzle\Inflection\InflectorInterface; - -/** - * Factory for creating {@see WaiterInterface} objects using a configuration DSL. - */ -class WaiterConfigFactory implements WaiterFactoryInterface -{ - /** - * @var array Configuration directives - */ - protected $config; - - /** - * @var InflectorInterface Inflector used to inflect class names - */ - protected $inflector; - - /** - * @param array $config Array of configuration directives - * @param InflectorInterface $inflector Inflector used to resolve class names - */ - public function __construct( - array $config, - InflectorInterface $inflector = null - ) { - $this->config = $config; - $this->inflector = $inflector ?: Inflector::getDefault(); - } - - /** - * {@inheritdoc} - */ - public function build($waiter) - { - return new ConfigResourceWaiter($this->getWaiterConfig($waiter)); - } - - /** - * {@inheritdoc} - */ - public function canBuild($waiter) - { - return isset($this->config[$waiter]) || isset($this->config[$this->inflector->camel($waiter)]); - } - - /** - * Get waiter configuration data, taking __default__ and extensions into account - * - * @param string $name Waiter name - * - * @return WaiterConfig - * @throws InvalidArgumentException - */ - protected function getWaiterConfig($name) - { - if (!$this->canBuild($name)) { - throw new InvalidArgumentException('No waiter found matching "' . $name . '"'); - } - - // inflect the name if needed - $name = isset($this->config[$name]) ? $name : $this->inflector->camel($name); - $waiter = new WaiterConfig($this->config[$name]); - $waiter['name'] = $name; - - // Always use __default__ as the basis if it's set - if (isset($this->config['__default__'])) { - $parentWaiter = new WaiterConfig($this->config['__default__']); - $waiter = $parentWaiter->overwriteWith($waiter); - } - - // Allow for configuration extensions - if (isset($this->config[$name]['extends'])) { - $waiter = $this->getWaiterConfig($this->config[$name]['extends'])->overwriteWith($waiter); - } - - return $waiter; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterFactoryInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterFactoryInterface.php deleted file mode 100644 index b9bf0f45b0b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterFactoryInterface.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\Common\Waiter; - -/** - * Waiter factory used to create waiter objects by short names - */ -interface WaiterFactoryInterface -{ - /** - * Create a waiter by name - * - * @param string $waiter Name of the waiter to create - * - * @return WaiterInterface - */ - public function build($waiter); - - /** - * Check if the factory can create a waiter by a specific name - * - * @param string $waiter Name of the waiter to check - * - * @return bool - */ - public function canBuild($waiter); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterInterface.php deleted file mode 100644 index a5966db8063..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Waiter/WaiterInterface.php +++ /dev/null @@ -1,60 +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\Common\Waiter; - -/** - * WaiterInterface used to wait on something to be in a particular state - */ -interface WaiterInterface -{ - const INTERVAL = 'waiter.interval'; - const MAX_ATTEMPTS = 'waiter.max_attempts'; - - /** - * Set the maximum number of attempts to make when waiting - * - * @param int $maxAttempts Max number of attempts - * - * @return self - */ - public function setMaxAttempts($maxAttempts); - - /** - * Set the amount of time to interval between attempts - * - * @param int $interval Interval in seconds - * - * @return self - */ - public function setInterval($interval); - - /** - * Set configuration options associated with the waiter - * - * @param array $config Configuration options to set - * - * @return self - */ - public function setConfig(array $config); - - /** - * Begin the waiting loop - * - * @throw RuntimeException if the method never resolves to true - */ - public function wait(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/AcpListener.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/AcpListener.php deleted file mode 100644 index 2d28407e129..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/AcpListener.php +++ /dev/null @@ -1,75 +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; - -use Aws\Common\Exception\InvalidArgumentException; -use Aws\S3\Model\Acp; -use Guzzle\Common\Event; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Listener used to add an Access Control Policy to a request - */ -class AcpListener implements EventSubscriberInterface -{ - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() - { - return array('command.before_prepare' => array('onCommandBeforePrepare', -255)); - } - - /** - * An event handler for constructing ACP definitions. - * - * @param Event $event The event to respond to. - * - * @throws InvalidArgumentException - */ - public function onCommandBeforePrepare(Event $event) - { - /** @var $command \Guzzle\Service\Command\AbstractCommand */ - $command = $event['command']; - $operation = $command->getOperation(); - if ($operation->hasParam('ACP') && $command->hasKey('ACP')) { - if ($acp = $command->get('ACP')) { - // Ensure that the correct object was passed - if (!($acp instanceof Acp)) { - throw new InvalidArgumentException('ACP must be an instance of Aws\S3\Model\Acp'); - } - - // Check if the user specified both an ACP and Grants - if ($command->hasKey('Grants')) { - throw new InvalidArgumentException( - 'Use either the ACP parameter or the Grants parameter. Do not use both.' - ); - } - - // Add the correct headers/body based parameters to the command - if ($operation->hasParam('Grants')) { - $command->overwriteWith($acp->toArray()); - } else { - $acp->updateCommand($command); - } - } - - // Remove the ACP parameter - $command->remove('ACP'); - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/BucketStyleListener.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/BucketStyleListener.php deleted file mode 100644 index 6bb5bb42cd9..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/BucketStyleListener.php +++ /dev/null @@ -1,85 +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; - -use Guzzle\Common\Event; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Listener used to change the way in which buckets are referenced (path/virtual style) based on context - */ -class BucketStyleListener implements EventSubscriberInterface -{ - /** - * {@inheritdoc} - */ - public static function getSubscribedEvents() - { - return array('command.after_prepare' => array('onCommandAfterPrepare', -255)); - } - - /** - * Changes how buckets are referenced in the HTTP request - * - * @param Event $event Event emitted - */ - public function onCommandAfterPrepare(Event $event) - { - $command = $event['command']; - $bucket = $command['Bucket']; - $request = $command->getRequest(); - $pathStyle = false; - - if ($key = $command['Key']) { - // Modify the command Key to account for the {/Key*} explosion into an array - if (is_array($key)) { - $command['Key'] = $key = implode('/', $key); - } - } - - // Set the key and bucket on the request - $request->getParams()->set('bucket', $bucket)->set('key', $key); - - // Switch to virtual if PathStyle is disabled, or not a DNS compatible bucket name, or the scheme is - // http, or the scheme is https and there are no dots in the host header (avoids SSL issues) - if (!$command['PathStyle'] && $command->getClient()->isValidBucketName($bucket) - && !($command->getRequest()->getScheme() == 'https' && strpos($bucket, '.')) - ) { - // Switch to virtual hosted bucket - $request->setHost($bucket . '.' . $request->getHost()); - $request->setPath(preg_replace("#^/{$bucket}#", '', $request->getPath())); - } else { - $pathStyle = true; - } - - if (!$bucket) { - $request->getParams()->set('s3.resource', '/'); - } elseif ($pathStyle) { - // Path style does not need a trailing slash - $request->getParams()->set( - 's3.resource', - '/' . rawurlencode($bucket) . ($key ? ('/' . S3Client::encodeKey($key)) : '') - ); - } else { - // Bucket style needs a trailing slash - $request->getParams()->set( - 's3.resource', - '/' . rawurlencode($bucket) . ($key ? ('/' . S3Client::encodeKey($key)) : '/') - ); - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Command/S3Command.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Command/S3Command.php deleted file mode 100644 index d0d3b24b203..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Command/S3Command.php +++ /dev/null @@ -1,65 +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\Command; - -use Guzzle\Service\Command\OperationCommand; -use Guzzle\Service\Resource\Model; -use Guzzle\Common\Event; - -/** - * Adds functionality to Amazon S3 commands: - * - Adds the PutObject URL to a response - * - Allows creating a Pre-signed URL from any command - */ -class S3Command extends OperationCommand -{ - /** - * Create a pre-signed URL for the operation - * - * @param int|string $expires The Unix timestamp to expire at or a string that can be evaluated by strtotime - * - * @return string - */ - public function createPresignedUrl($expires) - { - return $this->client->createPresignedUrl($this->prepare(), $expires); - } - - /** - * {@inheritdoc} - */ - protected function process() - { - $request = $this->getRequest(); - $response = $this->getResponse(); - - // Dispatch an error if a 301 redirect occurred - if ($response->getStatusCode() == 301) { - $this->getClient()->getEventDispatcher()->dispatch('request.error', new Event(array( - 'request' => $this->getRequest(), - 'response' => $response - ))); - } - - parent::process(); - - // Set the GetObject URL if using the PutObject operation - if ($this->result instanceof Model && $this->getName() == 'PutObject') { - $this->result->set('ObjectURL', $request->getUrl()); - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/CannedAcl.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/CannedAcl.php deleted file mode 100644 index da4704527bd..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/CannedAcl.php +++ /dev/null @@ -1,32 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable CannedAcl values - */ -class CannedAcl extends Enum -{ - const PRIVATE_ACCESS = 'private'; - const PUBLIC_READ = 'public-read'; - const PUBLIC_READ_WRITE = 'public-read-write'; - const AUTHENTICATED_READ = 'authenticated-read'; - const BUCKET_OWNER_READ = 'bucket-owner-read'; - const BUCKET_OWNER_FULL_CONTROL = 'bucket-owner-full-control'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/EncodingType.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/EncodingType.php deleted file mode 100644 index 0eaa3a44cf3..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/EncodingType.php +++ /dev/null @@ -1,27 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable EncodingType values - */ -class EncodingType extends Enum -{ - const URL = 'url'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Event.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Event.php deleted file mode 100644 index 05abcacb118..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Event.php +++ /dev/null @@ -1,27 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable Event values - */ -class Event extends Enum -{ - const REDUCED_REDUNDANCY_LOST_OBJECT = 's3:ReducedRedundancyLostObject'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/GranteeType.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/GranteeType.php deleted file mode 100644 index 5370047426e..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/GranteeType.php +++ /dev/null @@ -1,29 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable GranteeType values - */ -class GranteeType extends Enum -{ - const USER = 'CanonicalUser'; - const EMAIL = 'AmazonCustomerByEmail'; - const GROUP = 'Group'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Group.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Group.php deleted file mode 100644 index 06971631713..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Group.php +++ /dev/null @@ -1,29 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable Amazon S3 group options for ACL grantees - */ -class Group extends Enum -{ - const AUTHENTICATED_USERS = 'http://acs.amazonaws.com/groups/global/AuthenticatedUsers'; - const ALL_USERS = 'http://acs.amazonaws.com/groups/global/AllUsers'; - const LOG_DELIVERY = 'http://acs.amazonaws.com/groups/s3/LogDelivery'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/MFADelete.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/MFADelete.php deleted file mode 100644 index e92721e7353..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/MFADelete.php +++ /dev/null @@ -1,28 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable MFADelete values - */ -class MFADelete extends Enum -{ - const ENABLED = 'Enabled'; - const DISABLED = 'Disabled'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/MetadataDirective.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/MetadataDirective.php deleted file mode 100644 index 588ceed6d4f..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/MetadataDirective.php +++ /dev/null @@ -1,28 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable MetadataDirective values - */ -class MetadataDirective extends Enum -{ - const COPY = 'COPY'; - const REPLACE = 'REPLACE'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Payer.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Payer.php deleted file mode 100644 index 3016aa530f7..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Payer.php +++ /dev/null @@ -1,28 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable Payer values - */ -class Payer extends Enum -{ - const REQUESTER = 'Requester'; - const BUCKET_OWNER = 'BucketOwner'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Permission.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Permission.php deleted file mode 100644 index bafd226eaa7..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Permission.php +++ /dev/null @@ -1,31 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable Permission values - */ -class Permission extends Enum -{ - const FULL_CONTROL = 'FULL_CONTROL'; - const WRITE = 'WRITE'; - const WRITE_ACP = 'WRITE_ACP'; - const READ = 'READ'; - const READ_ACP = 'READ_ACP'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Protocol.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Protocol.php deleted file mode 100644 index 93b57e34a14..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Protocol.php +++ /dev/null @@ -1,28 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable Protocol values - */ -class Protocol extends Enum -{ - const HTTP = 'http'; - const HTTPS = 'https'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/ServerSideEncryption.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/ServerSideEncryption.php deleted file mode 100644 index 53256a12a9e..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/ServerSideEncryption.php +++ /dev/null @@ -1,27 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable ServerSideEncryption values - */ -class ServerSideEncryption extends Enum -{ - const AES256 = 'AES256'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Status.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Status.php deleted file mode 100644 index ddf6d262158..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Status.php +++ /dev/null @@ -1,28 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable Status values - */ -class Status extends Enum -{ - const ENABLED = 'Enabled'; - const SUSPENDED = 'Suspended'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Storage.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Storage.php deleted file mode 100644 index 5248a81cff5..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/Storage.php +++ /dev/null @@ -1,29 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable Amazon S3 storage options - */ -class Storage extends Enum -{ - const STANDARD = 'STANDARD'; - const REDUCED = 'REDUCED_REDUNDANCY'; - const GLACIER = 'GLACIER'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/StorageClass.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/StorageClass.php deleted file mode 100644 index 3b8ab117185..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Enum/StorageClass.php +++ /dev/null @@ -1,28 +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\Enum; - -use Aws\Common\Enum; - -/** - * Contains enumerable StorageClass values - */ -class StorageClass extends Enum -{ - const STANDARD = 'STANDARD'; - const REDUCED_REDUNDANCY = 'REDUCED_REDUNDANCY'; -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/AccessDeniedException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/AccessDeniedException.php deleted file mode 100644 index 7de2ef6447c..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/AccessDeniedException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Access Denied - */ -class AccessDeniedException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/AccountProblemException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/AccountProblemException.php deleted file mode 100644 index 5e1c7acd1bc..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/AccountProblemException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * There is a problem with your AWS account that prevents the operation from completing successfully. Please use Contact Us. - */ -class AccountProblemException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/AmbiguousGrantByEmailAddressException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/AmbiguousGrantByEmailAddressException.php deleted file mode 100644 index 77a57f51dbf..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/AmbiguousGrantByEmailAddressException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The e-mail address you provided is associated with more than one account. - */ -class AmbiguousGrantByEmailAddressException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BadDigestException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BadDigestException.php deleted file mode 100644 index 1cc642d3571..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BadDigestException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The Content-MD5 you specified did not match what we received. - */ -class BadDigestException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BucketAlreadyExistsException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BucketAlreadyExistsException.php deleted file mode 100644 index fade68bb1f7..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BucketAlreadyExistsException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again. - */ -class BucketAlreadyExistsException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BucketAlreadyOwnedByYouException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BucketAlreadyOwnedByYouException.php deleted file mode 100644 index 12462faab4d..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BucketAlreadyOwnedByYouException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Your previous request to create the named bucket succeeded and you already own it. - */ -class BucketAlreadyOwnedByYouException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BucketNotEmptyException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BucketNotEmptyException.php deleted file mode 100644 index e06bc30363f..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/BucketNotEmptyException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The bucket you tried to delete is not empty. - */ -class BucketNotEmptyException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/CredentialsNotSupportedException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/CredentialsNotSupportedException.php deleted file mode 100644 index 2568b4c2b64..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/CredentialsNotSupportedException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * This request does not support credentials. - */ -class CredentialsNotSupportedException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/CrossLocationLoggingProhibitedException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/CrossLocationLoggingProhibitedException.php deleted file mode 100644 index 9a6780ecf57..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/CrossLocationLoggingProhibitedException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Cross location logging not allowed. Buckets in one geographic location cannot log information to a bucket in another location. - */ -class CrossLocationLoggingProhibitedException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/DeleteMultipleObjectsException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/DeleteMultipleObjectsException.php deleted file mode 100644 index 44a3aa52849..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/DeleteMultipleObjectsException.php +++ /dev/null @@ -1,48 +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\Exception; - -/** - * Exception thrown when errors occur in a DeleteMultipleObjects request - */ -class DeleteMultipleObjectsException extends S3Exception -{ - /** - * @var array Array of errors - */ - protected $errors = array(); - - /** - * @param array $errors Array of errors - */ - public function __construct(array $errors = array()) - { - parent::__construct('Unable to delete certain keys when executing a DeleteMultipleObjects request'); - $this->errors = $errors; - } - - /** - * Get the errored objects - * - * @return array Returns an array of associative arrays, each containing - * a 'Code', 'Message', and 'Key' key. - */ - public function getErrors() - { - return $this->errors; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/EntityTooLargeException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/EntityTooLargeException.php deleted file mode 100644 index 66e6da94900..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/EntityTooLargeException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Your proposed upload exceeds the maximum allowed object size. - */ -class EntityTooLargeException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/EntityTooSmallException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/EntityTooSmallException.php deleted file mode 100644 index d4128dcc28a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/EntityTooSmallException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Your proposed upload is smaller than the minimum allowed object size. - */ -class EntityTooSmallException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ExpiredTokenException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ExpiredTokenException.php deleted file mode 100644 index 4ddeea4c4b6..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ExpiredTokenException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The provided token has expired. - */ -class ExpiredTokenException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/IllegalVersioningConfigurationException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/IllegalVersioningConfigurationException.php deleted file mode 100644 index 58185d7d76b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/IllegalVersioningConfigurationException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Indicates that the Versioning configuration specified in the request is invalid. - */ -class IllegalVersioningConfigurationException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/IncompleteBodyException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/IncompleteBodyException.php deleted file mode 100644 index b87a0647c90..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/IncompleteBodyException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * You did not provide the number of bytes specified by the Content-Length HTTP header - */ -class IncompleteBodyException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/IncorrectNumberOfFilesInPostRequestException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/IncorrectNumberOfFilesInPostRequestException.php deleted file mode 100644 index 6650722414a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/IncorrectNumberOfFilesInPostRequestException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * POST requires exactly one file upload per request. - */ -class IncorrectNumberOfFilesInPostRequestException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InlineDataTooLargeException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InlineDataTooLargeException.php deleted file mode 100644 index ec263e1de60..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InlineDataTooLargeException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Inline data exceeds the maximum allowed size. - */ -class InlineDataTooLargeException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InternalErrorException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InternalErrorException.php deleted file mode 100644 index 6640cdb0ab1..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InternalErrorException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * We encountered an internal error. Please try again. - */ -class InternalErrorException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidAccessKeyIdException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidAccessKeyIdException.php deleted file mode 100644 index f4d42f7c59a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidAccessKeyIdException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The AWS Access Key Id you provided does not exist in our records. - */ -class InvalidAccessKeyIdException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidAddressingHeaderException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidAddressingHeaderException.php deleted file mode 100644 index f49fd768dda..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidAddressingHeaderException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * You must specify the Anonymous role. - */ -class InvalidAddressingHeaderException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidArgumentException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidArgumentException.php deleted file mode 100644 index d540ffc3fa0..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Invalid Argument - */ -class InvalidArgumentException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidBucketNameException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidBucketNameException.php deleted file mode 100644 index 66b55d9afc9..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidBucketNameException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The specified bucket is not valid. - */ -class InvalidBucketNameException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidBucketStateException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidBucketStateException.php deleted file mode 100644 index 91cf817adbf..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidBucketStateException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The request is not valid with the current state of the bucket. - */ -class InvalidBucketStateException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidDigestException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidDigestException.php deleted file mode 100644 index 3c203b7683d..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidDigestException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The Content-MD5 you specified was an invalid. - */ -class InvalidDigestException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidLocationConstraintException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidLocationConstraintException.php deleted file mode 100644 index b30a7e6e0a8..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidLocationConstraintException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The specified location constraint is not valid. For more information about Regions, see How to Select a Region for Your Buckets. - */ -class InvalidLocationConstraintException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPartException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPartException.php deleted file mode 100644 index 200855288ed..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPartException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * One or more of the specified parts could not be found. The part might not have been uploaded, or the specified entity tag might not have matched the part's entity tag. - */ -class InvalidPartException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPartOrderException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPartOrderException.php deleted file mode 100644 index a04acdcaef4..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPartOrderException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The list of parts was not in ascending order.Parts list must specified in order by part number. - */ -class InvalidPartOrderException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPayerException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPayerException.php deleted file mode 100644 index 048de9bd715..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPayerException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * All access to this object has been disabled. - */ -class InvalidPayerException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPolicyDocumentException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPolicyDocumentException.php deleted file mode 100644 index 3fc24a3ca95..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidPolicyDocumentException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The content of the form does not meet the conditions specified in the policy document. - */ -class InvalidPolicyDocumentException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidRangeException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidRangeException.php deleted file mode 100644 index 455b05277db..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidRangeException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The requested range cannot be satisfied. - */ -class InvalidRangeException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidRequestException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidRequestException.php deleted file mode 100644 index 89e4c8f0038..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidRequestException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * SOAP requests must be made over an HTTPS connection. - */ -class InvalidRequestException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidSOAPRequestException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidSOAPRequestException.php deleted file mode 100644 index a8d8ce196e2..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidSOAPRequestException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The SOAP request body is invalid. - */ -class InvalidSOAPRequestException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidSecurityException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidSecurityException.php deleted file mode 100644 index 08fadd00945..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidSecurityException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The provided security credentials are not valid. - */ -class InvalidSecurityException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidStorageClassException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidStorageClassException.php deleted file mode 100644 index 09e66efba38..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidStorageClassException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The storage class you specified is not valid. - */ -class InvalidStorageClassException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidTagErrorException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidTagErrorException.php deleted file mode 100644 index 87f48ff82fd..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidTagErrorException.php +++ /dev/null @@ -1,23 +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\Exception; - -/** - * The Tag provided was not a valid tag. This can occur if the Tag did not pass input validation. See the - * CostAllocation docs for a description of valid tags. - */ -class InvalidTagErrorException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidTargetBucketForLoggingException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidTargetBucketForLoggingException.php deleted file mode 100644 index d81eab0195e..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidTargetBucketForLoggingException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The target bucket for logging does not exist, is not owned by you, or does not have the appropriate grants for the log-delivery group. - */ -class InvalidTargetBucketForLoggingException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidTokenException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidTokenException.php deleted file mode 100644 index b359ec04b73..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidTokenException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The provided token is malformed or otherwise invalid. - */ -class InvalidTokenException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidURIException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidURIException.php deleted file mode 100644 index cb3694e5668..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/InvalidURIException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Couldn't parse the specified URI. - */ -class InvalidURIException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/KeyTooLongException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/KeyTooLongException.php deleted file mode 100644 index e5a654a33c3..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/KeyTooLongException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Your key is too long. - */ -class KeyTooLongException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MalformedACLErrorException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MalformedACLErrorException.php deleted file mode 100644 index d1876c6342f..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MalformedACLErrorException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The XML you provided was not well-formed or did not validate against our published schema. - */ -class MalformedACLErrorException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MalformedPOSTRequestException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MalformedPOSTRequestException.php deleted file mode 100644 index ed0d572f184..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MalformedPOSTRequestException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The body of your POST request is not well-formed multipart/form-data. - */ -class MalformedPOSTRequestException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MalformedXMLException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MalformedXMLException.php deleted file mode 100644 index f23d96515a9..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MalformedXMLException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * This happens when the user sends a malformed xml (xml that doesn't conform to the published xsd) for the configuration. The error message is, "The XML you provided was not well-formed or did not validate against our published schema." - */ -class MalformedXMLException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MaxMessageLengthExceededException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MaxMessageLengthExceededException.php deleted file mode 100644 index e8f9bce7bcb..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MaxMessageLengthExceededException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Your request was too big. - */ -class MaxMessageLengthExceededException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MaxPostPreDataLengthExceededErrorException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MaxPostPreDataLengthExceededErrorException.php deleted file mode 100644 index 3fe204316ea..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MaxPostPreDataLengthExceededErrorException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Your POST request fields preceding the upload file were too large. - */ -class MaxPostPreDataLengthExceededErrorException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MetadataTooLargeException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MetadataTooLargeException.php deleted file mode 100644 index 584d3fdcdc4..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MetadataTooLargeException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Your metadata headers exceed the maximum allowed metadata size. - */ -class MetadataTooLargeException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MethodNotAllowedException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MethodNotAllowedException.php deleted file mode 100644 index 21dc7315558..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MethodNotAllowedException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The specified method is not allowed against this resource. - */ -class MethodNotAllowedException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingAttachmentException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingAttachmentException.php deleted file mode 100644 index e90e1a781e4..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingAttachmentException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * A SOAP attachment was expected, but none were found. - */ -class MissingAttachmentException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingContentLengthException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingContentLengthException.php deleted file mode 100644 index 19429f3090d..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingContentLengthException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * You must provide the Content-Length HTTP header. - */ -class MissingContentLengthException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingRequestBodyErrorException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingRequestBodyErrorException.php deleted file mode 100644 index 9b3f38e3af0..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingRequestBodyErrorException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * This happens when the user sends an empty xml document as a request. The error message is, "Request body is empty." - */ -class MissingRequestBodyErrorException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingSecurityElementException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingSecurityElementException.php deleted file mode 100644 index 8c74a8729e6..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingSecurityElementException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The SOAP 1.1 request is missing a security element. - */ -class MissingSecurityElementException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingSecurityHeaderException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingSecurityHeaderException.php deleted file mode 100644 index 4de9cfc9b42..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/MissingSecurityHeaderException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Your request was missing a required header. - */ -class MissingSecurityHeaderException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoLoggingStatusForKeyException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoLoggingStatusForKeyException.php deleted file mode 100644 index 339cb7677da..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoLoggingStatusForKeyException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * There is no such thing as a logging status sub-resource for a key. - */ -class NoLoggingStatusForKeyException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchBucketException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchBucketException.php deleted file mode 100644 index c13c16dcaa7..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchBucketException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The specified bucket does not exist. - */ -class NoSuchBucketException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchBucketPolicyException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchBucketPolicyException.php deleted file mode 100644 index 57f648a5f81..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchBucketPolicyException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The specified bucket policy does not exist. - */ -class NoSuchBucketPolicyException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchCORSConfigurationException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchCORSConfigurationException.php deleted file mode 100644 index 9aed8d9719b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchCORSConfigurationException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The specified bucket does not have a CORs configuration. - */ -class NoSuchCORSConfigurationException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchKeyException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchKeyException.php deleted file mode 100644 index 3b3124320f1..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchKeyException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The specified key does not exist. - */ -class NoSuchKeyException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchLifecycleConfigurationException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchLifecycleConfigurationException.php deleted file mode 100644 index 075b7c56efd..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchLifecycleConfigurationException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The lifecycle configuration does not exist. - */ -class NoSuchLifecycleConfigurationException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchTagSetErrorException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchTagSetErrorException.php deleted file mode 100644 index 12369bd19c9..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchTagSetErrorException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * There is no TagSet associated with the bucket. - */ -class NoSuchTagSetErrorException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchUploadException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchUploadException.php deleted file mode 100644 index 75789e4e4a8..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchUploadException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The specified multipart upload does not exist. - */ -class NoSuchUploadException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchVersionException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchVersionException.php deleted file mode 100644 index 3eb54db0373..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchVersionException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Indicates that the version ID specified in the request does not match an existing version. - */ -class NoSuchVersionException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchWebsiteConfigurationException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchWebsiteConfigurationException.php deleted file mode 100644 index b20c443ea27..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NoSuchWebsiteConfigurationException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The specified bucket does not have a website configuration. - */ -class NoSuchWebsiteConfigurationException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NotImplementedException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NotImplementedException.php deleted file mode 100644 index 065e49e5f32..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NotImplementedException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * A header you provided implies functionality that is not implemented. - */ -class NotImplementedException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NotSignedUpException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NotSignedUpException.php deleted file mode 100644 index 086fa3bdc43..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NotSignedUpException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Your account is not signed up for the Amazon S3 service. You must sign up before you can use Amazon S3. You can sign up at the following URL: http://aws.amazon.com/s3 - */ -class NotSignedUpException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NotSuchBucketPolicyException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NotSuchBucketPolicyException.php deleted file mode 100644 index 48f376af66a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/NotSuchBucketPolicyException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The specified bucket does not have a bucket policy. - */ -class NotSuchBucketPolicyException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ObjectAlreadyInActiveTierErrorException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ObjectAlreadyInActiveTierErrorException.php deleted file mode 100644 index 4361d521459..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ObjectAlreadyInActiveTierErrorException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * This operation is not allowed against this storage tier - */ -class ObjectAlreadyInActiveTierErrorException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ObjectNotInActiveTierErrorException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ObjectNotInActiveTierErrorException.php deleted file mode 100644 index 26ee3996a64..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ObjectNotInActiveTierErrorException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The source object of the COPY operation is not in the active tier and is only stored in Amazon Glacier. - */ -class ObjectNotInActiveTierErrorException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/OperationAbortedException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/OperationAbortedException.php deleted file mode 100644 index 245279aef5c..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/OperationAbortedException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * A conflicting conditional operation is currently in progress against this resource. Please try again. - */ -class OperationAbortedException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/Parser/S3ExceptionParser.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/Parser/S3ExceptionParser.php deleted file mode 100644 index a914204a87b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/Parser/S3ExceptionParser.php +++ /dev/null @@ -1,72 +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\Exception\Parser; - -use Aws\Common\Exception\Parser\DefaultXmlExceptionParser; -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\Message\Response; - -/** - * Parses S3 exception responses - */ -class S3ExceptionParser extends DefaultXmlExceptionParser -{ - /** - * {@inheritdoc} - */ - public function parse(RequestInterface $request, Response $response) - { - $data = parent::parse($request, $response); - - if ($response->getStatusCode() === 301) { - $data['type'] = 'client'; - if (isset($data['message'], $data['parsed'])) { - $data['message'] = rtrim($data['message'], '.') . ': "' . $data['parsed']->Endpoint . '".'; - } - } - - return $data; - } - - /** - * {@inheritdoc} - */ - protected function parseHeaders(RequestInterface $request, Response $response, array &$data) - { - parent::parseHeaders($request, $response, $data); - - // Get the request - $status = $response->getStatusCode(); - $method = $request->getMethod(); - - // Attempt to determine code for 403s and 404s - if ($status === 403) { - $data['code'] = 'AccessDenied'; - } elseif ($method === 'HEAD' && $status === 404) { - $path = explode('/', trim($request->getPath(), '/')); - $host = explode('.', $request->getHost()); - $bucket = (count($host) === 4) ? $host[0] : array_shift($path); - $object = array_shift($path); - - if ($bucket && $object) { - $data['code'] = 'NoSuchKey'; - } elseif ($bucket) { - $data['code'] = 'NoSuchBucket'; - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/PermanentRedirectException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/PermanentRedirectException.php deleted file mode 100644 index d2af82076c4..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/PermanentRedirectException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. - */ -class PermanentRedirectException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/PreconditionFailedException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/PreconditionFailedException.php deleted file mode 100644 index 8805432c342..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/PreconditionFailedException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * At least one of the preconditions you specified did not hold. - */ -class PreconditionFailedException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RedirectException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RedirectException.php deleted file mode 100644 index e89c816d480..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RedirectException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Temporary redirect. - */ -class RedirectException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestIsNotMultiPartContentException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestIsNotMultiPartContentException.php deleted file mode 100644 index b539feed64f..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestIsNotMultiPartContentException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Bucket POST must be of the enclosure-type multipart/form-data. - */ -class RequestIsNotMultiPartContentException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestTimeTooSkewedException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestTimeTooSkewedException.php deleted file mode 100644 index 37253901824..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestTimeTooSkewedException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The difference between the request time and the server's time is too large. - */ -class RequestTimeTooSkewedException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestTimeoutException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestTimeoutException.php deleted file mode 100644 index a00d50f0f26..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestTimeoutException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Your socket connection to the server was not read from or written to within the timeout period. - */ -class RequestTimeoutException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestTorrentOfBucketErrorException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestTorrentOfBucketErrorException.php deleted file mode 100644 index 8d46e150942..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/RequestTorrentOfBucketErrorException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Requesting the torrent file of a bucket is not permitted. - */ -class RequestTorrentOfBucketErrorException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/S3Exception.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/S3Exception.php deleted file mode 100644 index 29e82ed256b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/S3Exception.php +++ /dev/null @@ -1,24 +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\Exception; - -use Aws\Common\Exception\ServiceResponseException; - -/** - * Default service exception class - */ -class S3Exception extends ServiceResponseException {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ServiceUnavailableException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ServiceUnavailableException.php deleted file mode 100644 index 390a30a3fea..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/ServiceUnavailableException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Please reduce your request rate. - */ -class ServiceUnavailableException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/SignatureDoesNotMatchException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/SignatureDoesNotMatchException.php deleted file mode 100644 index 3dfe98c78ce..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/SignatureDoesNotMatchException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. For more information, see REST Authentication and SOAP Authentication for details. - */ -class SignatureDoesNotMatchException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/SlowDownException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/SlowDownException.php deleted file mode 100644 index 4e3aea7c439..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/SlowDownException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * Please reduce your request rate. - */ -class SlowDownException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/TemporaryRedirectException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/TemporaryRedirectException.php deleted file mode 100644 index 37abedf0807..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/TemporaryRedirectException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * You are being redirected to the bucket while DNS updates. - */ -class TemporaryRedirectException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/TokenRefreshRequiredException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/TokenRefreshRequiredException.php deleted file mode 100644 index 31f29dd57bf..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/TokenRefreshRequiredException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The provided token must be refreshed. - */ -class TokenRefreshRequiredException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/TooManyBucketsException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/TooManyBucketsException.php deleted file mode 100644 index c49605c40ac..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/TooManyBucketsException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * You have attempted to create more buckets than allowed. - */ -class TooManyBucketsException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/UnexpectedContentException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/UnexpectedContentException.php deleted file mode 100644 index ea105ca494d..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/UnexpectedContentException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * This request does not support content. - */ -class UnexpectedContentException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/UnresolvableGrantByEmailAddressException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/UnresolvableGrantByEmailAddressException.php deleted file mode 100644 index 2138a57fc1a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/UnresolvableGrantByEmailAddressException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The e-mail address you provided does not match any account on record. - */ -class UnresolvableGrantByEmailAddressException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/UserKeyMustBeSpecifiedException.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/UserKeyMustBeSpecifiedException.php deleted file mode 100644 index f1bcc9c07ad..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Exception/UserKeyMustBeSpecifiedException.php +++ /dev/null @@ -1,22 +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\Exception; - -/** - * The bucket POST must contain the specified field name. If it is specified, please check the order of the fields. - */ -class UserKeyMustBeSpecifiedException extends S3Exception {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListBucketsIterator.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListBucketsIterator.php deleted file mode 100644 index 7437cf9f3d2..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListBucketsIterator.php +++ /dev/null @@ -1,48 +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\Iterator; - -use Aws\Common\Iterator\AwsResourceIterator; -use Guzzle\Service\Resource\Model; - -/** - * Iterator for the S3 ListBuckets command - * - * This iterator includes the following additional options: - * - * - names_only: Set to true to receive only the object/prefix names - */ -class ListBucketsIterator extends AwsResourceIterator -{ - /** - * {@inheritdoc} - */ - protected function handleResults(Model $result) - { - // Get the results - $buckets = $result->get('Buckets') ?: array(); - - // If only the names_only set, change arrays to a string - if ($this->get('names_only')) { - foreach ($buckets as &$bucket) { - $bucket = $bucket['Name']; - } - } - - return $buckets; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListMultipartUploadsIterator.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListMultipartUploadsIterator.php deleted file mode 100644 index 592aa0a9b99..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListMultipartUploadsIterator.php +++ /dev/null @@ -1,46 +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\Iterator; - -use Guzzle\Service\Resource\Model; -use Aws\Common\Iterator\AwsResourceIterator; - -/** - * Iterator for the S3 ListMultipartUploads command - * - * This iterator includes the following additional options: - * - * - return_prefixes: Set to true to return both prefixes and uploads - */ -class ListMultipartUploadsIterator extends AwsResourceIterator -{ - /** - * {@inheritdoc} - */ - protected function handleResults(Model $result) - { - // Get the list of uploads - $uploads = $result->get('Uploads') ?: array(); - - // If there are prefixes and we want them, merge them in - if ($this->get('return_prefixes') && $result->hasKey('CommonPrefixes')) { - $uploads = array_merge($uploads, $result->get('CommonPrefixes')); - } - - return $uploads; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListObjectVersionsIterator.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListObjectVersionsIterator.php deleted file mode 100644 index 991a77e1f22..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListObjectVersionsIterator.php +++ /dev/null @@ -1,48 +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\Iterator; - -use Aws\Common\Iterator\AwsResourceIterator; -use Guzzle\Service\Resource\Model; - -/** - * Iterator for an S3 ListObjectVersions command - * - * This iterator includes the following additional options: - * - * - return_prefixes: Set to true to receive both prefixes and versions in results - */ -class ListObjectVersionsIterator extends AwsResourceIterator -{ - /** - * {@inheritdoc} - */ - protected function handleResults(Model $result) - { - // Get the list of object versions - $versions = $result->get('Versions') ?: array(); - $deleteMarkers = $result->get('DeleteMarkers') ?: array(); - $versions = array_merge($versions, $deleteMarkers); - - // If there are prefixes and we want them, merge them in - if ($this->get('return_prefixes') && $result->hasKey('CommonPrefixes')) { - $versions = array_merge($versions, $result->get('CommonPrefixes')); - } - - return $versions; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListObjectsIterator.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListObjectsIterator.php deleted file mode 100644 index 852b2a992fa..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/ListObjectsIterator.php +++ /dev/null @@ -1,68 +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\Iterator; - -use Aws\Common\Iterator\AwsResourceIterator; -use Guzzle\Service\Resource\Model; - -/** - * Iterator for an S3 ListObjects command - * - * This iterator includes the following additional options: - * - * - return_prefixes: Set to true to receive both prefixes and objects in results - * - sort_results: Set to true to sort mixed (object/prefix) results - * - names_only: Set to true to receive only the object/prefix names - */ -class ListObjectsIterator extends AwsResourceIterator -{ - protected function handleResults(Model $result) - { - // Get the list of objects and record the last key - $objects = $result->get('Contents') ?: array(); - $numObjects = count($objects); - $lastKey = $numObjects ? $objects[$numObjects - 1]['Key'] : false; - if ($lastKey && !$result->hasKey($this->get('output_token'))) { - $result->set($this->get('output_token'), $lastKey); - } - - // Closure for getting the name of an object or prefix - $getName = function ($object) { - return isset($object['Key']) ? $object['Key'] : $object['Prefix']; - }; - - // If common prefixes returned (i.e. a delimiter was set) and they need to be returned, there is more to do - if ($this->get('return_prefixes') && $result->hasKey('CommonPrefixes')) { - // Collect and format the prefixes to include with the objects - $objects = array_merge($objects, $result->get('CommonPrefixes')); - - // Sort the objects and prefixes to maintain alphabetical order, but only if some of each were returned - if ($this->get('sort_results') && $lastKey && $objects) { - usort($objects, function ($object1, $object2) use ($getName) { - return strcmp($getName($object1), $getName($object2)); - }); - } - } - - // If only the names are desired, iterate through the results and convert the arrays to the object/prefix names - if ($this->get('names_only')) { - $objects = array_map($getName, $objects); - } - - return $objects; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/OpendirIterator.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/OpendirIterator.php deleted file mode 100644 index 82c0153ed51..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Iterator/OpendirIterator.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\Iterator; - -/** - * Provides an iterator around an opendir resource. This is useful when you need to provide context to an opendir so - * you can't use RecursiveDirectoryIterator - */ -class OpendirIterator implements \Iterator -{ - /** @var resource */ - protected $dirHandle; - - /** @var \SplFileInfo */ - protected $currentFile; - - /** @var int */ - protected $key = -1; - - /** @var string */ - protected $filePrefix; - - /** - * @param resource $dirHandle Opened directory handled returned from opendir - * @param string $filePrefix Prefix to add to each filename - */ - public function __construct($dirHandle, $filePrefix = '') - { - $this->filePrefix = $filePrefix; - $this->dirHandle = $dirHandle; - $this->next(); - } - - public function __destruct() - { - if ($this->dirHandle) { - closedir($this->dirHandle); - } - } - - public function rewind() - { - $this->key = 0; - rewinddir($this->dirHandle); - } - - public function current() - { - return $this->currentFile; - } - - public function next() - { - if ($file = readdir($this->dirHandle)) { - $this->currentFile = new \SplFileInfo($this->filePrefix . $file); - } else { - $this->currentFile = false; - } - - $this->key++; - } - - public function key() - { - return $this->key; - } - - public function valid() - { - return $this->currentFile !== false; - } -} 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 - )); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Resources/s3-2006-03-01.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Resources/s3-2006-03-01.php deleted file mode 100644 index 0d7b023f029..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Resources/s3-2006-03-01.php +++ /dev/null @@ -1,4711 +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. - */ - -return array ( - 'apiVersion' => '2006-03-01', - 'endpointPrefix' => 's3', - 'serviceFullName' => 'Amazon Simple Storage Service', - 'serviceAbbreviation' => 'Amazon S3', - 'serviceType' => 'rest-xml', - 'timestampFormat' => 'rfc822', - 'globalEndpoint' => 's3.amazonaws.com', - 'signatureVersion' => 's3', - 'namespace' => 'S3', - 'regions' => array( - 'us-east-1' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3.amazonaws.com', - ), - 'us-west-1' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3-us-west-1.amazonaws.com', - ), - 'us-west-2' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3-us-west-2.amazonaws.com', - ), - 'eu-west-1' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3-eu-west-1.amazonaws.com', - ), - 'eu-central-1' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3-eu-central-1.amazonaws.com', - ), - 'ap-northeast-1' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3-ap-northeast-1.amazonaws.com', - ), - 'ap-southeast-1' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3-ap-southeast-1.amazonaws.com', - ), - 'ap-southeast-2' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3-ap-southeast-2.amazonaws.com', - ), - 'sa-east-1' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3-sa-east-1.amazonaws.com', - ), - 'cn-north-1' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3.cn-north-1.amazonaws.com.cn', - ), - 'us-gov-west-1' => array( - 'http' => true, - 'https' => true, - 'hostname' => 's3-us-gov-west-1.amazonaws.com', - ), - ), - 'operations' => array( - 'AbortMultipartUpload' => array( - 'httpMethod' => 'DELETE', - 'uri' => '/{Bucket}{/Key*}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'AbortMultipartUploadOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadAbort.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'UploadId' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'uploadId', - ), - ), - 'errorResponses' => array( - array( - 'reason' => 'The specified multipart upload does not exist.', - 'class' => 'NoSuchUploadException', - ), - ), - ), - 'CompleteMultipartUpload' => array( - 'httpMethod' => 'POST', - 'uri' => '/{Bucket}{/Key*}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'CompleteMultipartUploadOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadComplete.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'CompleteMultipartUpload', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'Parts' => array( - 'type' => 'array', - 'location' => 'xml', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'CompletedPart', - 'type' => 'object', - 'sentAs' => 'Part', - 'properties' => array( - 'ETag' => array( - 'type' => 'string', - ), - 'PartNumber' => array( - 'type' => 'numeric', - ), - ), - ), - ), - 'UploadId' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'uploadId', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'CopyObject' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}{/Key*}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'CopyObjectOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'CopyObjectRequest', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'ACL' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-acl', - ), - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'CacheControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Cache-Control', - ), - 'ContentDisposition' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Disposition', - ), - 'ContentEncoding' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Encoding', - ), - 'ContentLanguage' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Language', - ), - 'ContentType' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Type', - ), - 'CopySource' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source', - ), - 'CopySourceIfMatch' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-if-match', - ), - 'CopySourceIfModifiedSince' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-if-modified-since', - ), - 'CopySourceIfNoneMatch' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-if-none-match', - ), - 'CopySourceIfUnmodifiedSince' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-if-unmodified-since', - ), - 'Expires' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - ), - 'GrantFullControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-full-control', - ), - 'GrantRead' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read', - ), - 'GrantReadACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read-acp', - ), - 'GrantWriteACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-write-acp', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'Metadata' => array( - 'type' => 'object', - 'location' => 'header', - 'sentAs' => 'x-amz-meta-', - 'additionalProperties' => array( - 'type' => 'string', - ), - ), - 'MetadataDirective' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-metadata-directive', - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'StorageClass' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-storage-class', - ), - 'WebsiteRedirectLocation' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-website-redirect-location', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKey' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'CopySourceSSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-server-side-encryption-customer-algorithm', - ), - 'CopySourceSSECustomerKey' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-server-side-encryption-customer-key', - ), - 'CopySourceSSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-server-side-encryption-customer-key-MD5', - ), - 'CopySourceSSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-server-side-encryption-aws-kms-key-id', - ), - 'ACP' => array( - 'type' => 'object', - 'additionalProperties' => true, - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - 'errorResponses' => array( - array( - 'reason' => 'The source object of the COPY operation is not in the active tier and is only stored in Amazon Glacier.', - 'class' => 'ObjectNotInActiveTierErrorException', - ), - ), - ), - 'CreateBucket' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'CreateBucketOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUT.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'CreateBucketConfiguration', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'ACL' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-acl', - ), - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'LocationConstraint' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'GrantFullControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-full-control', - ), - 'GrantRead' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read', - ), - 'GrantReadACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read-acp', - ), - 'GrantWrite' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-write', - ), - 'GrantWriteACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-write-acp', - ), - 'ACP' => array( - 'type' => 'object', - 'additionalProperties' => true, - ), - ), - 'errorResponses' => array( - array( - 'reason' => 'The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.', - 'class' => 'BucketAlreadyExistsException', - ), - ), - ), - 'CreateMultipartUpload' => array( - 'httpMethod' => 'POST', - 'uri' => '/{Bucket}{/Key*}?uploads', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'CreateMultipartUploadOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadInitiate.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'CreateMultipartUploadRequest', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'ACL' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-acl', - ), - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'CacheControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Cache-Control', - ), - 'ContentDisposition' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Disposition', - ), - 'ContentEncoding' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Encoding', - ), - 'ContentLanguage' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Language', - ), - 'ContentType' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Type', - ), - 'Expires' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - ), - 'GrantFullControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-full-control', - ), - 'GrantRead' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read', - ), - 'GrantReadACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read-acp', - ), - 'GrantWriteACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-write-acp', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'Metadata' => array( - 'type' => 'object', - 'location' => 'header', - 'sentAs' => 'x-amz-meta-', - 'additionalProperties' => array( - 'type' => 'string', - ), - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'StorageClass' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-storage-class', - ), - 'WebsiteRedirectLocation' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-website-redirect-location', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKey' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'ACP' => array( - 'type' => 'object', - 'additionalProperties' => true, - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'DeleteBucket' => array( - 'httpMethod' => 'DELETE', - 'uri' => '/{Bucket}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'DeleteBucketOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketDELETE.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - ), - ), - 'DeleteBucketCors' => array( - 'httpMethod' => 'DELETE', - 'uri' => '/{Bucket}?cors', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'DeleteBucketCorsOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketDELETEcors.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - ), - ), - 'DeleteBucketLifecycle' => array( - 'httpMethod' => 'DELETE', - 'uri' => '/{Bucket}?lifecycle', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'DeleteBucketLifecycleOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketDELETElifecycle.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - ), - ), - 'DeleteBucketPolicy' => array( - 'httpMethod' => 'DELETE', - 'uri' => '/{Bucket}?policy', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'DeleteBucketPolicyOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketDELETEpolicy.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - ), - ), - 'DeleteBucketTagging' => array( - 'httpMethod' => 'DELETE', - 'uri' => '/{Bucket}?tagging', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'DeleteBucketTaggingOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketDELETEtagging.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - ), - ), - 'DeleteBucketWebsite' => array( - 'httpMethod' => 'DELETE', - 'uri' => '/{Bucket}?website', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'DeleteBucketWebsiteOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketDELETEwebsite.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - ), - ), - 'DeleteObject' => array( - 'httpMethod' => 'DELETE', - 'uri' => '/{Bucket}{/Key*}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'DeleteObjectOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'MFA' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-mfa', - ), - 'VersionId' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'versionId', - ), - ), - ), - 'DeleteObjects' => array( - 'httpMethod' => 'POST', - 'uri' => '/{Bucket}?delete', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'DeleteObjectsOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/multiobjectdeleteapi.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'Delete', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - 'contentMd5' => true, - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Objects' => array( - 'required' => true, - 'type' => 'array', - 'location' => 'xml', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'ObjectIdentifier', - 'type' => 'object', - 'sentAs' => 'Object', - 'properties' => array( - 'Key' => array( - 'required' => true, - 'type' => 'string', - ), - 'VersionId' => array( - 'type' => 'string', - ), - ), - ), - ), - 'Quiet' => array( - 'type' => 'boolean', - 'format' => 'boolean-string', - 'location' => 'xml', - ), - 'MFA' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-mfa', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'GetBucketAcl' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?acl', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketAclOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETacl.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'GetBucketCors' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?cors', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketCorsOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETcors.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'GetBucketLifecycle' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?lifecycle', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketLifecycleOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlifecycle.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'GetBucketLocation' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?location', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketLocationOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - ), - ), - 'GetBucketLogging' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?logging', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketLoggingOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlogging.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'GetBucketNotification' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?notification', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketNotificationOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETnotification.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'GetBucketPolicy' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?policy', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketPolicyOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETpolicy.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - ), - ), - 'GetBucketRequestPayment' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?requestPayment', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketRequestPaymentOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTrequestPaymentGET.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'GetBucketTagging' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?tagging', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketTaggingOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETtagging.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'GetBucketVersioning' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?versioning', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketVersioningOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETversioningStatus.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'GetBucketWebsite' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?website', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetBucketWebsiteOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETwebsite.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'GetObject' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}{/Key*}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetObjectOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectGET.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'IfMatch' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'If-Match', - ), - 'IfModifiedSince' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - 'sentAs' => 'If-Modified-Since', - ), - 'IfNoneMatch' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'If-None-Match', - ), - 'IfUnmodifiedSince' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - 'sentAs' => 'If-Unmodified-Since', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'Range' => array( - 'type' => 'string', - 'location' => 'header', - ), - 'ResponseCacheControl' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'response-cache-control', - ), - 'ResponseContentDisposition' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'response-content-disposition', - ), - 'ResponseContentEncoding' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'response-content-encoding', - ), - 'ResponseContentLanguage' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'response-content-language', - ), - 'ResponseContentType' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'response-content-type', - ), - 'ResponseExpires' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'query', - 'sentAs' => 'response-expires', - ), - 'VersionId' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'versionId', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKey' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'SaveAs' => array( - 'location' => 'response_body', - ), - ), - 'errorResponses' => array( - array( - 'reason' => 'The specified key does not exist.', - 'class' => 'NoSuchKeyException', - ), - ), - ), - 'GetObjectAcl' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}{/Key*}?acl', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetObjectAclOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectGETacl.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'VersionId' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'versionId', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - 'errorResponses' => array( - array( - 'reason' => 'The specified key does not exist.', - 'class' => 'NoSuchKeyException', - ), - ), - ), - 'GetObjectTorrent' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}{/Key*}?torrent', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'GetObjectTorrentOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectGETtorrent.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - ), - ), - 'HeadBucket' => array( - 'httpMethod' => 'HEAD', - 'uri' => '/{Bucket}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'HeadBucketOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketHEAD.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - ), - 'errorResponses' => array( - array( - 'reason' => 'The specified bucket does not exist.', - 'class' => 'NoSuchBucketException', - ), - ), - ), - 'HeadObject' => array( - 'httpMethod' => 'HEAD', - 'uri' => '/{Bucket}{/Key*}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'HeadObjectOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectHEAD.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'IfMatch' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'If-Match', - ), - 'IfModifiedSince' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - 'sentAs' => 'If-Modified-Since', - ), - 'IfNoneMatch' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'If-None-Match', - ), - 'IfUnmodifiedSince' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - 'sentAs' => 'If-Unmodified-Since', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'Range' => array( - 'type' => 'string', - 'location' => 'header', - ), - 'VersionId' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'versionId', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKey' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - ), - 'errorResponses' => array( - array( - 'reason' => 'The specified key does not exist.', - 'class' => 'NoSuchKeyException', - ), - ), - ), - 'ListBuckets' => array( - 'httpMethod' => 'GET', - 'uri' => '/', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'ListBucketsOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTServiceGET.html', - 'parameters' => array( - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'ListMultipartUploads' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?uploads', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'ListMultipartUploadsOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadListMPUpload.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Delimiter' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'delimiter', - ), - 'EncodingType' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'encoding-type', - ), - 'KeyMarker' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'key-marker', - ), - 'MaxUploads' => array( - 'type' => 'numeric', - 'location' => 'query', - 'sentAs' => 'max-uploads', - ), - 'Prefix' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'prefix', - ), - 'UploadIdMarker' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'upload-id-marker', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'ListObjectVersions' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}?versions', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'ListObjectVersionsOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETVersion.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Delimiter' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'delimiter', - ), - 'EncodingType' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'encoding-type', - ), - 'KeyMarker' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'key-marker', - ), - 'MaxKeys' => array( - 'type' => 'numeric', - 'location' => 'query', - 'sentAs' => 'max-keys', - ), - 'Prefix' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'prefix', - ), - 'VersionIdMarker' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'version-id-marker', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'ListObjects' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'ListObjectsOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Delimiter' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'delimiter', - ), - 'EncodingType' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'encoding-type', - ), - 'Marker' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'marker', - ), - 'MaxKeys' => array( - 'type' => 'numeric', - 'location' => 'query', - 'sentAs' => 'max-keys', - ), - 'Prefix' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'prefix', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - 'errorResponses' => array( - array( - 'reason' => 'The specified bucket does not exist.', - 'class' => 'NoSuchBucketException', - ), - ), - ), - 'ListParts' => array( - 'httpMethod' => 'GET', - 'uri' => '/{Bucket}{/Key*}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'ListPartsOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadListParts.html', - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'MaxParts' => array( - 'type' => 'numeric', - 'location' => 'query', - 'sentAs' => 'max-parts', - ), - 'PartNumberMarker' => array( - 'type' => 'numeric', - 'location' => 'query', - 'sentAs' => 'part-number-marker', - ), - 'UploadId' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'uploadId', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - 'PutBucketAcl' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}?acl', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutBucketAclOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTacl.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'AccessControlPolicy', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'ACL' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-acl', - ), - 'Grants' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'AccessControlList', - 'items' => array( - 'name' => 'Grant', - 'type' => 'object', - 'properties' => array( - 'Grantee' => array( - 'type' => 'object', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'EmailAddress' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - 'Type' => array( - 'required' => true, - 'type' => 'string', - 'sentAs' => 'xsi:type', - 'data' => array( - 'xmlAttribute' => true, - 'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance', - ), - ), - 'URI' => array( - 'type' => 'string', - ), - ), - ), - 'Permission' => array( - 'type' => 'string', - ), - ), - ), - ), - 'Owner' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - ), - ), - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'GrantFullControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-full-control', - ), - 'GrantRead' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read', - ), - 'GrantReadACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read-acp', - ), - 'GrantWrite' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-write', - ), - 'GrantWriteACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-write-acp', - ), - 'ACP' => array( - 'type' => 'object', - 'additionalProperties' => true, - ), - ), - ), - 'PutBucketCors' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}?cors', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutBucketCorsOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTcors.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'CORSConfiguration', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - 'contentMd5' => true, - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'CORSRules' => array( - 'type' => 'array', - 'location' => 'xml', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'CORSRule', - 'type' => 'object', - 'sentAs' => 'CORSRule', - 'properties' => array( - 'AllowedHeaders' => array( - 'type' => 'array', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'AllowedHeader', - 'type' => 'string', - 'sentAs' => 'AllowedHeader', - ), - ), - 'AllowedMethods' => array( - 'type' => 'array', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'AllowedMethod', - 'type' => 'string', - 'sentAs' => 'AllowedMethod', - ), - ), - 'AllowedOrigins' => array( - 'type' => 'array', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'AllowedOrigin', - 'type' => 'string', - 'sentAs' => 'AllowedOrigin', - ), - ), - 'ExposeHeaders' => array( - 'type' => 'array', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'ExposeHeader', - 'type' => 'string', - 'sentAs' => 'ExposeHeader', - ), - ), - 'MaxAgeSeconds' => array( - 'type' => 'numeric', - ), - ), - ), - ), - ), - ), - 'PutBucketLifecycle' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}?lifecycle', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutBucketLifecycleOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'LifecycleConfiguration', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - 'contentMd5' => true, - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Rules' => array( - 'required' => true, - 'type' => 'array', - 'location' => 'xml', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Rule', - 'type' => 'object', - 'sentAs' => 'Rule', - 'properties' => array( - 'Expiration' => array( - 'type' => 'object', - 'properties' => array( - 'Date' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time', - ), - 'Days' => array( - 'type' => 'numeric', - ), - ), - ), - 'ID' => array( - 'type' => 'string', - ), - 'Prefix' => array( - 'required' => true, - 'type' => 'string', - ), - 'Status' => array( - 'required' => true, - 'type' => 'string', - ), - 'Transition' => array( - 'type' => 'object', - 'properties' => array( - 'Date' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time', - ), - 'Days' => array( - 'type' => 'numeric', - ), - 'StorageClass' => array( - 'type' => 'string', - ), - ), - ), - 'NoncurrentVersionTransition' => array( - 'type' => 'object', - 'properties' => array( - 'NoncurrentDays' => array( - 'type' => 'numeric', - ), - 'StorageClass' => array( - 'type' => 'string', - ), - ), - ), - 'NoncurrentVersionExpiration' => array( - 'type' => 'object', - 'properties' => array( - 'NoncurrentDays' => array( - 'type' => 'numeric', - ), - ), - ), - ), - ), - ), - ), - ), - 'PutBucketLogging' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}?logging', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutBucketLoggingOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'BucketLoggingStatus', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - 'xmlAllowEmpty' => true, - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'LoggingEnabled' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'TargetBucket' => array( - 'type' => 'string', - ), - 'TargetGrants' => array( - 'type' => 'array', - 'items' => array( - 'name' => 'Grant', - 'type' => 'object', - 'properties' => array( - 'Grantee' => array( - 'type' => 'object', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'EmailAddress' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - 'Type' => array( - 'required' => true, - 'type' => 'string', - 'sentAs' => 'xsi:type', - 'data' => array( - 'xmlAttribute' => true, - 'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance', - ), - ), - 'URI' => array( - 'type' => 'string', - ), - ), - ), - 'Permission' => array( - 'type' => 'string', - ), - ), - ), - ), - 'TargetPrefix' => array( - 'type' => 'string', - ), - ), - ), - ), - ), - 'PutBucketNotification' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}?notification', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutBucketNotificationOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTnotification.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'NotificationConfiguration', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'TopicConfiguration' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'Id' => array( - 'type' => 'string', - ), - 'Events' => array( - 'type' => 'array', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Event', - 'type' => 'string', - ), - ), - 'Event' => array( - 'type' => 'string', - ), - 'Topic' => array( - 'type' => 'string', - ), - ), - ), - 'QueueConfiguration' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'Id' => array( - 'type' => 'string', - ), - 'Event' => array( - 'type' => 'string', - ), - 'Events' => array( - 'type' => 'array', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Event', - 'type' => 'string', - ), - ), - 'Queue' => array( - 'type' => 'string', - ), - ), - ), - 'CloudFunctionConfiguration' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'Id' => array( - 'type' => 'string', - ), - 'Event' => array( - 'type' => 'string', - ), - 'Events' => array( - 'type' => 'array', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Event', - 'type' => 'string', - ), - ), - 'CloudFunction' => array( - 'type' => 'string', - ), - 'InvocationRole' => array( - 'type' => 'string', - ), - ), - ), - ), - ), - 'PutBucketPolicy' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}?policy', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutBucketPolicyOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTpolicy.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'PutBucketPolicyRequest', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Policy' => array( - 'required' => true, - 'type' => array( - 'string', - 'object', - ), - 'location' => 'body', - ), - ), - ), - 'PutBucketRequestPayment' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}?requestPayment', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutBucketRequestPaymentOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTrequestPaymentPUT.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'RequestPaymentConfiguration', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Payer' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'xml', - ), - ), - ), - 'PutBucketTagging' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}?tagging', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutBucketTaggingOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTtagging.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'Tagging', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - 'contentMd5' => true, - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'TagSet' => array( - 'required' => true, - 'type' => 'array', - 'location' => 'xml', - 'items' => array( - 'name' => 'Tag', - 'type' => 'object', - 'properties' => array( - 'Key' => array( - 'required' => true, - 'type' => 'string', - ), - 'Value' => array( - 'required' => true, - 'type' => 'string', - ), - ), - ), - ), - ), - ), - 'PutBucketVersioning' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}?versioning', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutBucketVersioningOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'VersioningConfiguration', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'MFA' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-mfa', - ), - 'MFADelete' => array( - 'type' => 'string', - 'location' => 'xml', - 'sentAs' => 'MfaDelete', - ), - 'Status' => array( - 'type' => 'string', - 'location' => 'xml', - ), - ), - ), - 'PutBucketWebsite' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}?website', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutBucketWebsiteOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTwebsite.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'WebsiteConfiguration', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - 'xmlAllowEmpty' => true, - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'ErrorDocument' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'Key' => array( - 'required' => true, - 'type' => 'string', - ), - ), - ), - 'IndexDocument' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'Suffix' => array( - 'required' => true, - 'type' => 'string', - ), - ), - ), - 'RedirectAllRequestsTo' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'HostName' => array( - 'required' => true, - 'type' => 'string', - ), - 'Protocol' => array( - 'type' => 'string', - ), - ), - ), - 'RoutingRules' => array( - 'type' => 'array', - 'location' => 'xml', - 'items' => array( - 'name' => 'RoutingRule', - 'type' => 'object', - 'properties' => array( - 'Condition' => array( - 'type' => 'object', - 'properties' => array( - 'HttpErrorCodeReturnedEquals' => array( - 'type' => 'string', - ), - 'KeyPrefixEquals' => array( - 'type' => 'string', - ), - ), - ), - 'Redirect' => array( - 'required' => true, - 'type' => 'object', - 'properties' => array( - 'HostName' => array( - 'type' => 'string', - ), - 'HttpRedirectCode' => array( - 'type' => 'string', - ), - 'Protocol' => array( - 'type' => 'string', - ), - 'ReplaceKeyPrefixWith' => array( - 'type' => 'string', - ), - 'ReplaceKeyWith' => array( - 'type' => 'string', - ), - ), - ), - ), - ), - ), - ), - ), - 'PutObject' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}{/Key*}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutObjectOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'PutObjectRequest', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'ACL' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-acl', - ), - 'Body' => array( - 'type' => array( - 'string', - 'object', - ), - 'location' => 'body', - ), - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'CacheControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Cache-Control', - ), - 'ContentDisposition' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Disposition', - ), - 'ContentEncoding' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Encoding', - ), - 'ContentLanguage' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Language', - ), - 'ContentLength' => array( - 'type' => 'numeric', - 'location' => 'header', - 'sentAs' => 'Content-Length', - ), - 'ContentMD5' => array( - 'type' => array( - 'string', - 'boolean', - ), - 'location' => 'header', - 'sentAs' => 'Content-MD5', - ), - 'ContentType' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Type', - ), - 'Expires' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - ), - 'GrantFullControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-full-control', - ), - 'GrantRead' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read', - ), - 'GrantReadACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read-acp', - ), - 'GrantWriteACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-write-acp', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'Metadata' => array( - 'type' => 'object', - 'location' => 'header', - 'sentAs' => 'x-amz-meta-', - 'additionalProperties' => array( - 'type' => 'string', - ), - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'StorageClass' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-storage-class', - ), - 'WebsiteRedirectLocation' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-website-redirect-location', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKey' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'ACP' => array( - 'type' => 'object', - 'additionalProperties' => true, - ), - ), - ), - 'PutObjectAcl' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}{/Key*}?acl', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'PutObjectAclOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTacl.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'AccessControlPolicy', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'ACL' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-acl', - ), - 'Grants' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'AccessControlList', - 'items' => array( - 'name' => 'Grant', - 'type' => 'object', - 'properties' => array( - 'Grantee' => array( - 'type' => 'object', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'EmailAddress' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - 'Type' => array( - 'required' => true, - 'type' => 'string', - 'sentAs' => 'xsi:type', - 'data' => array( - 'xmlAttribute' => true, - 'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance', - ), - ), - 'URI' => array( - 'type' => 'string', - ), - ), - ), - 'Permission' => array( - 'type' => 'string', - ), - ), - ), - ), - 'Owner' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - ), - ), - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'GrantFullControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-full-control', - ), - 'GrantRead' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read', - ), - 'GrantReadACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-read-acp', - ), - 'GrantWrite' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-write', - ), - 'GrantWriteACP' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-grant-write-acp', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'ACP' => array( - 'type' => 'object', - 'additionalProperties' => true, - ), - ), - 'errorResponses' => array( - array( - 'reason' => 'The specified key does not exist.', - 'class' => 'NoSuchKeyException', - ), - ), - ), - 'RestoreObject' => array( - 'httpMethod' => 'POST', - 'uri' => '/{Bucket}{/Key*}?restore', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'RestoreObjectOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectRestore.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'RestoreRequest', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'VersionId' => array( - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'versionId', - ), - 'Days' => array( - 'required' => true, - 'type' => 'numeric', - 'location' => 'xml', - ), - ), - 'errorResponses' => array( - array( - 'reason' => 'This operation is not allowed against this storage tier', - 'class' => 'ObjectAlreadyInActiveTierErrorException', - ), - ), - ), - 'UploadPart' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}{/Key*}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'UploadPartOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadUploadPart.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'UploadPartRequest', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'Body' => array( - 'type' => array( - 'string', - 'object', - ), - 'location' => 'body', - ), - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'ContentLength' => array( - 'type' => 'numeric', - 'location' => 'header', - 'sentAs' => 'Content-Length', - ), - 'ContentMD5' => array( - 'type' => array( - 'string', - 'boolean', - ), - 'location' => 'header', - 'sentAs' => 'Content-MD5', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'PartNumber' => array( - 'required' => true, - 'type' => 'numeric', - 'location' => 'query', - 'sentAs' => 'partNumber', - ), - 'UploadId' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'uploadId', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKey' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - ), - ), - 'UploadPartCopy' => array( - 'httpMethod' => 'PUT', - 'uri' => '/{Bucket}{/Key*}', - 'class' => 'Aws\\S3\\Command\\S3Command', - 'responseClass' => 'UploadPartCopyOutput', - 'responseType' => 'model', - 'documentationUrl' => 'http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadUploadPartCopy.html', - 'data' => array( - 'xmlRoot' => array( - 'name' => 'UploadPartCopyRequest', - 'namespaces' => array( - 'http://s3.amazonaws.com/doc/2006-03-01/', - ), - ), - ), - 'parameters' => array( - 'Bucket' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - ), - 'CopySource' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source', - ), - 'CopySourceIfMatch' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-if-match', - ), - 'CopySourceIfModifiedSince' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-if-modified-since', - ), - 'CopySourceIfNoneMatch' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-if-none-match', - ), - 'CopySourceIfUnmodifiedSince' => array( - 'type' => array( - 'object', - 'string', - 'integer', - ), - 'format' => 'date-time-http', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-if-unmodified-since', - ), - 'CopySourceRange' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-range', - ), - 'Key' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'uri', - 'filters' => array( - 'Aws\\S3\\S3Client::explodeKey', - ), - ), - 'PartNumber' => array( - 'required' => true, - 'type' => 'numeric', - 'location' => 'query', - 'sentAs' => 'partNumber', - ), - 'UploadId' => array( - 'required' => true, - 'type' => 'string', - 'location' => 'query', - 'sentAs' => 'uploadId', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKey' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'CopySourceSSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-server-side-encryption-customer-algorithm', - ), - 'CopySourceSSECustomerKey' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-server-side-encryption-customer-key', - ), - 'CopySourceSSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-server-side-encryption-customer-key-MD5', - ), - 'CopySourceSSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'command.expects' => array( - 'static' => true, - 'default' => 'application/xml', - ), - ), - ), - ), - 'models' => array( - 'AbortMultipartUploadOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'CompleteMultipartUploadOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Location' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Bucket' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Key' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Expiration' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-expiration', - ), - 'ETag' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'VersionId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-version-id', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'CopyObjectOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'ETag' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'LastModified' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Expiration' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-expiration', - ), - 'CopySourceVersionId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-version-id', - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'CreateBucketOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Location' => array( - 'type' => 'string', - 'location' => 'header', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'CreateMultipartUploadOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Bucket' => array( - 'type' => 'string', - 'location' => 'xml', - 'sentAs' => 'Bucket', - ), - 'Key' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'UploadId' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'DeleteBucketOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'DeleteBucketCorsOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'DeleteBucketLifecycleOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'DeleteBucketPolicyOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'DeleteBucketTaggingOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'DeleteBucketWebsiteOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'DeleteObjectOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'DeleteMarker' => array( - 'type' => 'boolean', - 'location' => 'header', - 'sentAs' => 'x-amz-delete-marker', - ), - 'VersionId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-version-id', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'DeleteObjectsOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Deleted' => array( - 'type' => 'array', - 'location' => 'xml', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'DeletedObject', - 'type' => 'object', - 'properties' => array( - 'Key' => array( - 'type' => 'string', - ), - 'VersionId' => array( - 'type' => 'string', - ), - 'DeleteMarker' => array( - 'type' => 'boolean', - ), - 'DeleteMarkerVersionId' => array( - 'type' => 'string', - ), - ), - ), - ), - 'Errors' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'Error', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Error', - 'type' => 'object', - 'sentAs' => 'Error', - 'properties' => array( - 'Key' => array( - 'type' => 'string', - ), - 'VersionId' => array( - 'type' => 'string', - ), - 'Code' => array( - 'type' => 'string', - ), - 'Message' => array( - 'type' => 'string', - ), - ), - ), - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetBucketAclOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Owner' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - ), - ), - 'Grants' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'AccessControlList', - 'items' => array( - 'name' => 'Grant', - 'type' => 'object', - 'sentAs' => 'Grant', - 'properties' => array( - 'Grantee' => array( - 'type' => 'object', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'EmailAddress' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - 'Type' => array( - 'type' => 'string', - 'sentAs' => 'xsi:type', - 'data' => array( - 'xmlAttribute' => true, - 'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance', - ), - ), - 'URI' => array( - 'type' => 'string', - ), - ), - ), - 'Permission' => array( - 'type' => 'string', - ), - ), - ), - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetBucketCorsOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'CORSRules' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'CORSRule', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'CORSRule', - 'type' => 'object', - 'sentAs' => 'CORSRule', - 'properties' => array( - 'AllowedHeaders' => array( - 'type' => 'array', - 'sentAs' => 'AllowedHeader', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'AllowedHeader', - 'type' => 'string', - 'sentAs' => 'AllowedHeader', - ), - ), - 'AllowedMethods' => array( - 'type' => 'array', - 'sentAs' => 'AllowedMethod', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'AllowedMethod', - 'type' => 'string', - 'sentAs' => 'AllowedMethod', - ), - ), - 'AllowedOrigins' => array( - 'type' => 'array', - 'sentAs' => 'AllowedOrigin', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'AllowedOrigin', - 'type' => 'string', - 'sentAs' => 'AllowedOrigin', - ), - ), - 'ExposeHeaders' => array( - 'type' => 'array', - 'sentAs' => 'ExposeHeader', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'ExposeHeader', - 'type' => 'string', - 'sentAs' => 'ExposeHeader', - ), - ), - 'MaxAgeSeconds' => array( - 'type' => 'numeric', - ), - ), - ), - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetBucketLifecycleOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Rules' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'Rule', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Rule', - 'type' => 'object', - 'sentAs' => 'Rule', - 'properties' => array( - 'Expiration' => array( - 'type' => 'object', - 'properties' => array( - 'Date' => array( - 'type' => 'string', - ), - 'Days' => array( - 'type' => 'numeric', - ), - ), - ), - 'ID' => array( - 'type' => 'string', - ), - 'Prefix' => array( - 'type' => 'string', - ), - 'Status' => array( - 'type' => 'string', - ), - 'Transition' => array( - 'type' => 'object', - 'properties' => array( - 'Date' => array( - 'type' => 'string', - ), - 'Days' => array( - 'type' => 'numeric', - ), - 'StorageClass' => array( - 'type' => 'string', - ), - ), - ), - 'NoncurrentVersionTransition' => array( - 'type' => 'object', - 'properties' => array( - 'NoncurrentDays' => array( - 'type' => 'numeric', - ), - 'StorageClass' => array( - 'type' => 'string', - ), - ), - ), - 'NoncurrentVersionExpiration' => array( - 'type' => 'object', - 'properties' => array( - 'NoncurrentDays' => array( - 'type' => 'numeric', - ), - ), - ), - ), - ), - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetBucketLocationOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Location' => array( - 'type' => 'string', - 'location' => 'body', - 'filters' => array( - 'strval', - 'strip_tags', - 'trim', - ), - ), - ), - ), - 'GetBucketLoggingOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'LoggingEnabled' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'TargetBucket' => array( - 'type' => 'string', - ), - 'TargetGrants' => array( - 'type' => 'array', - 'items' => array( - 'name' => 'Grant', - 'type' => 'object', - 'sentAs' => 'Grant', - 'properties' => array( - 'Grantee' => array( - 'type' => 'object', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'EmailAddress' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - 'Type' => array( - 'type' => 'string', - 'sentAs' => 'xsi:type', - 'data' => array( - 'xmlAttribute' => true, - 'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance', - ), - ), - 'URI' => array( - 'type' => 'string', - ), - ), - ), - 'Permission' => array( - 'type' => 'string', - ), - ), - ), - ), - 'TargetPrefix' => array( - 'type' => 'string', - ), - ), - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetBucketNotificationOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'TopicConfiguration' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'Id' => array( - 'type' => 'string', - ), - 'Events' => array( - 'type' => 'array', - 'sentAs' => 'Event', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Event', - 'type' => 'string', - 'sentAs' => 'Event', - ), - ), - 'Event' => array( - 'type' => 'string', - ), - 'Topic' => array( - 'type' => 'string', - ), - ), - ), - 'QueueConfiguration' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'Id' => array( - 'type' => 'string', - ), - 'Event' => array( - 'type' => 'string', - ), - 'Events' => array( - 'type' => 'array', - 'sentAs' => 'Event', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Event', - 'type' => 'string', - 'sentAs' => 'Event', - ), - ), - 'Queue' => array( - 'type' => 'string', - ), - ), - ), - 'CloudFunctionConfiguration' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'Id' => array( - 'type' => 'string', - ), - 'Event' => array( - 'type' => 'string', - ), - 'Events' => array( - 'type' => 'array', - 'sentAs' => 'Event', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Event', - 'type' => 'string', - 'sentAs' => 'Event', - ), - ), - 'CloudFunction' => array( - 'type' => 'string', - ), - 'InvocationRole' => array( - 'type' => 'string', - ), - ), - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetBucketPolicyOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Policy' => array( - 'type' => 'string', - 'instanceOf' => 'Guzzle\\Http\\EntityBody', - 'location' => 'body', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetBucketRequestPaymentOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Payer' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetBucketTaggingOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'TagSet' => array( - 'type' => 'array', - 'location' => 'xml', - 'items' => array( - 'name' => 'Tag', - 'type' => 'object', - 'sentAs' => 'Tag', - 'properties' => array( - 'Key' => array( - 'type' => 'string', - ), - 'Value' => array( - 'type' => 'string', - ), - ), - ), - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetBucketVersioningOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Status' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'MFADelete' => array( - 'type' => 'string', - 'location' => 'xml', - 'sentAs' => 'MfaDelete', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetBucketWebsiteOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RedirectAllRequestsTo' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'HostName' => array( - 'type' => 'string', - ), - 'Protocol' => array( - 'type' => 'string', - ), - ), - ), - 'IndexDocument' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'Suffix' => array( - 'type' => 'string', - ), - ), - ), - 'ErrorDocument' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'Key' => array( - 'type' => 'string', - ), - ), - ), - 'RoutingRules' => array( - 'type' => 'array', - 'location' => 'xml', - 'items' => array( - 'name' => 'RoutingRule', - 'type' => 'object', - 'sentAs' => 'RoutingRule', - 'properties' => array( - 'Condition' => array( - 'type' => 'object', - 'properties' => array( - 'HttpErrorCodeReturnedEquals' => array( - 'type' => 'string', - ), - 'KeyPrefixEquals' => array( - 'type' => 'string', - ), - ), - ), - 'Redirect' => array( - 'type' => 'object', - 'properties' => array( - 'HostName' => array( - 'type' => 'string', - ), - 'HttpRedirectCode' => array( - 'type' => 'string', - ), - 'Protocol' => array( - 'type' => 'string', - ), - 'ReplaceKeyPrefixWith' => array( - 'type' => 'string', - ), - 'ReplaceKeyWith' => array( - 'type' => 'string', - ), - ), - ), - ), - ), - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetObjectOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Body' => array( - 'type' => 'string', - 'instanceOf' => 'Guzzle\\Http\\EntityBody', - 'location' => 'body', - ), - 'DeleteMarker' => array( - 'type' => 'boolean', - 'location' => 'header', - 'sentAs' => 'x-amz-delete-marker', - ), - 'AcceptRanges' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'accept-ranges', - ), - 'Expiration' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-expiration', - ), - 'Restore' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-restore', - ), - 'LastModified' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Last-Modified', - ), - 'ContentLength' => array( - 'type' => 'numeric', - 'location' => 'header', - 'sentAs' => 'Content-Length', - ), - 'ETag' => array( - 'type' => 'string', - 'location' => 'header', - ), - 'MissingMeta' => array( - 'type' => 'numeric', - 'location' => 'header', - 'sentAs' => 'x-amz-missing-meta', - ), - 'VersionId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-version-id', - ), - 'CacheControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Cache-Control', - ), - 'ContentDisposition' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Disposition', - ), - 'ContentEncoding' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Encoding', - ), - 'ContentLanguage' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Language', - ), - 'ContentType' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Type', - ), - 'Expires' => array( - 'type' => 'string', - 'location' => 'header', - ), - 'WebsiteRedirectLocation' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-website-redirect-location', - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'Metadata' => array( - 'type' => 'object', - 'location' => 'header', - 'sentAs' => 'x-amz-meta-', - 'additionalProperties' => array( - 'type' => 'string', - ), - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetObjectAclOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Owner' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - ), - ), - 'Grants' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'AccessControlList', - 'items' => array( - 'name' => 'Grant', - 'type' => 'object', - 'sentAs' => 'Grant', - 'properties' => array( - 'Grantee' => array( - 'type' => 'object', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'EmailAddress' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - 'Type' => array( - 'type' => 'string', - 'sentAs' => 'xsi:type', - 'data' => array( - 'xmlAttribute' => true, - 'xmlNamespace' => 'http://www.w3.org/2001/XMLSchema-instance', - ), - ), - 'URI' => array( - 'type' => 'string', - ), - ), - ), - 'Permission' => array( - 'type' => 'string', - ), - ), - ), - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'GetObjectTorrentOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Body' => array( - 'type' => 'string', - 'instanceOf' => 'Guzzle\\Http\\EntityBody', - 'location' => 'body', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'HeadBucketOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'HeadObjectOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'DeleteMarker' => array( - 'type' => 'boolean', - 'location' => 'header', - 'sentAs' => 'x-amz-delete-marker', - ), - 'AcceptRanges' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'accept-ranges', - ), - 'Expiration' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-expiration', - ), - 'Restore' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-restore', - ), - 'LastModified' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Last-Modified', - ), - 'ContentLength' => array( - 'type' => 'numeric', - 'location' => 'header', - 'sentAs' => 'Content-Length', - ), - 'ETag' => array( - 'type' => 'string', - 'location' => 'header', - ), - 'MissingMeta' => array( - 'type' => 'numeric', - 'location' => 'header', - 'sentAs' => 'x-amz-missing-meta', - ), - 'VersionId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-version-id', - ), - 'CacheControl' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Cache-Control', - ), - 'ContentDisposition' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Disposition', - ), - 'ContentEncoding' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Encoding', - ), - 'ContentLanguage' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Language', - ), - 'ContentType' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'Content-Type', - ), - 'Expires' => array( - 'type' => 'string', - 'location' => 'header', - ), - 'WebsiteRedirectLocation' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-website-redirect-location', - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'Metadata' => array( - 'type' => 'object', - 'location' => 'header', - 'sentAs' => 'x-amz-meta-', - 'additionalProperties' => array( - 'type' => 'string', - ), - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'ListBucketsOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Buckets' => array( - 'type' => 'array', - 'location' => 'xml', - 'items' => array( - 'name' => 'Bucket', - 'type' => 'object', - 'sentAs' => 'Bucket', - 'properties' => array( - 'Name' => array( - 'type' => 'string', - ), - 'CreationDate' => array( - 'type' => 'string', - ), - ), - ), - ), - 'Owner' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - ), - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'ListMultipartUploadsOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Bucket' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'KeyMarker' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'UploadIdMarker' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'NextKeyMarker' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Prefix' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Delimiter' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'NextUploadIdMarker' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'MaxUploads' => array( - 'type' => 'numeric', - 'location' => 'xml', - ), - 'IsTruncated' => array( - 'type' => 'boolean', - 'location' => 'xml', - ), - 'Uploads' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'Upload', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'MultipartUpload', - 'type' => 'object', - 'sentAs' => 'Upload', - 'properties' => array( - 'UploadId' => array( - 'type' => 'string', - ), - 'Key' => array( - 'type' => 'string', - ), - 'Initiated' => array( - 'type' => 'string', - ), - 'StorageClass' => array( - 'type' => 'string', - ), - 'Owner' => array( - 'type' => 'object', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - ), - ), - 'Initiator' => array( - 'type' => 'object', - 'properties' => array( - 'ID' => array( - 'type' => 'string', - ), - 'DisplayName' => array( - 'type' => 'string', - ), - ), - ), - ), - ), - ), - 'CommonPrefixes' => array( - 'type' => 'array', - 'location' => 'xml', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'CommonPrefix', - 'type' => 'object', - 'properties' => array( - 'Prefix' => array( - 'type' => 'string', - ), - ), - ), - ), - 'EncodingType' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'ListObjectVersionsOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'IsTruncated' => array( - 'type' => 'boolean', - 'location' => 'xml', - ), - 'KeyMarker' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'VersionIdMarker' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'NextKeyMarker' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'NextVersionIdMarker' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Versions' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'Version', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'ObjectVersion', - 'type' => 'object', - 'sentAs' => 'Version', - 'properties' => array( - 'ETag' => array( - 'type' => 'string', - ), - 'Size' => array( - 'type' => 'numeric', - ), - 'StorageClass' => array( - 'type' => 'string', - ), - 'Key' => array( - 'type' => 'string', - ), - 'VersionId' => array( - 'type' => 'string', - ), - 'IsLatest' => array( - 'type' => 'boolean', - ), - 'LastModified' => array( - 'type' => 'string', - ), - 'Owner' => array( - 'type' => 'object', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - ), - ), - ), - ), - ), - 'DeleteMarkers' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'DeleteMarker', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'DeleteMarkerEntry', - 'type' => 'object', - 'sentAs' => 'DeleteMarker', - 'properties' => array( - 'Owner' => array( - 'type' => 'object', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - ), - ), - 'Key' => array( - 'type' => 'string', - ), - 'VersionId' => array( - 'type' => 'string', - ), - 'IsLatest' => array( - 'type' => 'boolean', - ), - 'LastModified' => array( - 'type' => 'string', - ), - ), - ), - ), - 'Name' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Prefix' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Delimiter' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'MaxKeys' => array( - 'type' => 'numeric', - 'location' => 'xml', - ), - 'CommonPrefixes' => array( - 'type' => 'array', - 'location' => 'xml', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'CommonPrefix', - 'type' => 'object', - 'properties' => array( - 'Prefix' => array( - 'type' => 'string', - ), - ), - ), - ), - 'EncodingType' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'ListObjectsOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'IsTruncated' => array( - 'type' => 'boolean', - 'location' => 'xml', - ), - 'Marker' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'NextMarker' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Contents' => array( - 'type' => 'array', - 'location' => 'xml', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Object', - 'type' => 'object', - 'properties' => array( - 'Key' => array( - 'type' => 'string', - ), - 'LastModified' => array( - 'type' => 'string', - ), - 'ETag' => array( - 'type' => 'string', - ), - 'Size' => array( - 'type' => 'numeric', - ), - 'StorageClass' => array( - 'type' => 'string', - ), - 'Owner' => array( - 'type' => 'object', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - ), - ), - ), - ), - ), - 'Name' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Prefix' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Delimiter' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'MaxKeys' => array( - 'type' => 'numeric', - 'location' => 'xml', - ), - 'CommonPrefixes' => array( - 'type' => 'array', - 'location' => 'xml', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'CommonPrefix', - 'type' => 'object', - 'properties' => array( - 'Prefix' => array( - 'type' => 'string', - ), - ), - ), - ), - 'EncodingType' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'ListPartsOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Bucket' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'Key' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'UploadId' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'PartNumberMarker' => array( - 'type' => 'numeric', - 'location' => 'xml', - ), - 'NextPartNumberMarker' => array( - 'type' => 'numeric', - 'location' => 'xml', - ), - 'MaxParts' => array( - 'type' => 'numeric', - 'location' => 'xml', - ), - 'IsTruncated' => array( - 'type' => 'boolean', - 'location' => 'xml', - ), - 'Parts' => array( - 'type' => 'array', - 'location' => 'xml', - 'sentAs' => 'Part', - 'data' => array( - 'xmlFlattened' => true, - ), - 'items' => array( - 'name' => 'Part', - 'type' => 'object', - 'sentAs' => 'Part', - 'properties' => array( - 'PartNumber' => array( - 'type' => 'numeric', - ), - 'LastModified' => array( - 'type' => 'string', - ), - 'ETag' => array( - 'type' => 'string', - ), - 'Size' => array( - 'type' => 'numeric', - ), - ), - ), - ), - 'Initiator' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'ID' => array( - 'type' => 'string', - ), - 'DisplayName' => array( - 'type' => 'string', - ), - ), - ), - 'Owner' => array( - 'type' => 'object', - 'location' => 'xml', - 'properties' => array( - 'DisplayName' => array( - 'type' => 'string', - ), - 'ID' => array( - 'type' => 'string', - ), - ), - ), - 'StorageClass' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutBucketAclOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutBucketCorsOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutBucketLifecycleOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutBucketLoggingOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutBucketNotificationOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutBucketPolicyOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutBucketRequestPaymentOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutBucketTaggingOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutBucketVersioningOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutBucketWebsiteOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'PutObjectOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'Expiration' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-expiration', - ), - 'ETag' => array( - 'type' => 'string', - 'location' => 'header', - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'VersionId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-version-id', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - 'ObjectURL' => array( - ), - ), - ), - 'PutObjectAclOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'RestoreObjectOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'UploadPartOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'ETag' => array( - 'type' => 'string', - 'location' => 'header', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - 'UploadPartCopyOutput' => array( - 'type' => 'object', - 'additionalProperties' => true, - 'properties' => array( - 'CopySourceVersionId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-copy-source-version-id', - ), - 'ETag' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'LastModified' => array( - 'type' => 'string', - 'location' => 'xml', - ), - 'ServerSideEncryption' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption', - ), - 'SSECustomerAlgorithm' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-algorithm', - ), - 'SSECustomerKeyMD5' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-customer-key-MD5', - ), - 'SSEKMSKeyId' => array( - 'type' => 'string', - 'location' => 'header', - 'sentAs' => 'x-amz-server-side-encryption-aws-kms-key-id', - ), - 'RequestId' => array( - 'location' => 'header', - 'sentAs' => 'x-amz-request-id', - ), - ), - ), - ), - 'iterators' => array( - 'ListBuckets' => array( - 'result_key' => 'Buckets', - ), - 'ListMultipartUploads' => array( - 'limit_key' => 'MaxUploads', - 'more_results' => 'IsTruncated', - 'output_token' => array( - 'NextKeyMarker', - 'NextUploadIdMarker', - ), - 'input_token' => array( - 'KeyMarker', - 'UploadIdMarker', - ), - 'result_key' => array( - 'Uploads', - 'CommonPrefixes', - ), - ), - 'ListObjectVersions' => array( - 'more_results' => 'IsTruncated', - 'limit_key' => 'MaxKeys', - 'output_token' => array( - 'NextKeyMarker', - 'NextVersionIdMarker', - ), - 'input_token' => array( - 'KeyMarker', - 'VersionIdMarker', - ), - 'result_key' => array( - 'Versions', - 'DeleteMarkers', - 'CommonPrefixes', - ), - ), - 'ListObjects' => array( - 'more_results' => 'IsTruncated', - 'limit_key' => 'MaxKeys', - 'output_token' => 'NextMarker', - 'input_token' => 'Marker', - 'result_key' => array( - 'Contents', - 'CommonPrefixes', - ), - ), - 'ListParts' => array( - 'more_results' => 'IsTruncated', - 'limit_key' => 'MaxParts', - 'output_token' => 'NextPartNumberMarker', - 'input_token' => 'PartNumberMarker', - 'result_key' => 'Parts', - ), - ), - 'waiters' => array( - '__default__' => array( - 'interval' => 5, - 'max_attempts' => 20, - ), - 'BucketExists' => array( - 'operation' => 'HeadBucket', - 'success.type' => 'output', - 'ignore_errors' => array( - 'NoSuchBucket', - ), - ), - 'BucketNotExists' => array( - 'operation' => 'HeadBucket', - 'success.type' => 'error', - 'success.value' => 'NoSuchBucket', - ), - 'ObjectExists' => array( - 'operation' => 'HeadObject', - 'success.type' => 'output', - 'ignore_errors' => array( - 'NoSuchKey', - ), - ), - ), -); diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/ResumableDownload.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/ResumableDownload.php deleted file mode 100644 index 386a077370d..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/ResumableDownload.php +++ /dev/null @@ -1,176 +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; - -use Aws\Common\Exception\RuntimeException; -use Aws\Common\Exception\UnexpectedValueException; -use Guzzle\Http\EntityBody; -use Guzzle\Http\ReadLimitEntityBody; -use Guzzle\Http\EntityBodyInterface; -use Guzzle\Service\Resource\Model; - -/** - * Allows you to resume the download of a partially downloaded object. - * - * Downloads objects from Amazon S3 in using "Range" downloads. This allows a partially downloaded object to be resumed - * so that only the remaining portion of the object is downloaded. - */ -class ResumableDownload -{ - /** @var S3Client The S3 client to use to download objects and issue HEAD requests */ - protected $client; - - /** @var \Guzzle\Service\Resource\Model Model object returned when the initial HeadObject operation was called */ - protected $meta; - - /** @var array Array of parameters to pass to a GetObject operation */ - protected $params; - - /** @var \Guzzle\Http\EntityBody Where the object will be downloaded */ - protected $target; - - /** - * @param S3Client $client Client to use when executing requests - * @param string $bucket Bucket that holds the object - * @param string $key Key of the object - * @param string|resource|EntityBodyInterface $target Where the object should be downloaded to. Pass a string to - * save the object to a file, pass a resource returned by - * fopen() to save the object to a stream resource, or pass a - * Guzzle EntityBody object to save the contents to an - * EntityBody. - * @param array $params Any additional GetObject or HeadObject parameters to use - * with each command issued by the client. (e.g. pass "Version" - * to download a specific version of an object) - * @throws RuntimeException if the target variable points to a file that cannot be opened - */ - public function __construct(S3Client $client, $bucket, $key, $target, array $params = array()) - { - $this->params = $params; - $this->client = $client; - $this->params['Bucket'] = $bucket; - $this->params['Key'] = $key; - - // If a string is passed, then assume that the download should stream to a file on disk - if (is_string($target)) { - if (!($target = fopen($target, 'a+'))) { - throw new RuntimeException("Unable to open {$target} for writing"); - } - // Always append to the file - fseek($target, 0, SEEK_END); - } - - // Get the metadata and Content-MD5 of the object - $this->target = EntityBody::factory($target); - } - - /** - * Get the bucket of the download - * - * @return string - */ - public function getBucket() - { - return $this->params['Bucket']; - } - - /** - * Get the key of the download - * - * @return string - */ - public function getKey() - { - return $this->params['Key']; - } - - /** - * Get the file to which the contents are downloaded - * - * @return string - */ - public function getFilename() - { - return $this->target->getUri(); - } - - /** - * Download the remainder of the object from Amazon S3 - * - * Performs a message integrity check if possible - * - * @return Model - */ - public function __invoke() - { - $command = $this->client->getCommand('HeadObject', $this->params); - $this->meta = $command->execute(); - - if ($this->target->ftell() >= $this->meta['ContentLength']) { - return false; - } - - $this->meta['ContentMD5'] = (string) $command->getResponse()->getHeader('Content-MD5'); - - // Use a ReadLimitEntityBody so that rewinding the stream after an error does not cause the file pointer - // to enter an inconsistent state with the data being downloaded - $this->params['SaveAs'] = new ReadLimitEntityBody( - $this->target, - $this->meta['ContentLength'], - $this->target->ftell() - ); - - $result = $this->getRemaining(); - $this->checkIntegrity(); - - return $result; - } - - /** - * Send the command to get the remainder of the object - * - * @return Model - */ - protected function getRemaining() - { - $current = $this->target->ftell(); - $targetByte = $this->meta['ContentLength'] - 1; - $this->params['Range'] = "bytes={$current}-{$targetByte}"; - - // Set the starting offset so that the body is never seeked to before this point in the event of a retry - $this->params['SaveAs']->setOffset($current); - $command = $this->client->getCommand('GetObject', $this->params); - - return $command->execute(); - } - - /** - * Performs an MD5 message integrity check if possible - * - * @throws UnexpectedValueException if the message does not validate - */ - protected function checkIntegrity() - { - if ($this->target->isReadable() && $expected = $this->meta['ContentMD5']) { - $actual = $this->target->getContentMd5(); - if ($actual != $expected) { - throw new UnexpectedValueException( - "Message integrity check failed. Expected {$expected} but got {$actual}." - ); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3Client.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3Client.php deleted file mode 100644 index 7f7c7cf22c4..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3Client.php +++ /dev/null @@ -1,680 +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; - -use Aws\Common\Client\AbstractClient; -use Aws\Common\Client\ClientBuilder; -use Aws\Common\Client\ExpiredCredentialsChecker; -use Aws\Common\Client\UploadBodyListener; -use Aws\Common\Enum\ClientOptions as Options; -use Aws\Common\Exception\RuntimeException; -use Aws\Common\Exception\InvalidArgumentException; -use Aws\Common\Signature\SignatureV4; -use Aws\Common\Model\MultipartUpload\AbstractTransfer; -use Aws\S3\Exception\AccessDeniedException; -use Aws\S3\Exception\Parser\S3ExceptionParser; -use Aws\S3\Exception\S3Exception; -use Aws\S3\Model\ClearBucket; -use Aws\S3\Model\MultipartUpload\AbstractTransfer as AbstractMulti; -use Aws\S3\Model\MultipartUpload\UploadBuilder; -use Aws\S3\Sync\DownloadSyncBuilder; -use Aws\S3\Sync\UploadSyncBuilder; -use Guzzle\Common\Collection; -use Guzzle\Http\EntityBody; -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Iterator\FilterIterator; -use Guzzle\Plugin\Backoff\BackoffPlugin; -use Guzzle\Plugin\Backoff\CurlBackoffStrategy; -use Guzzle\Plugin\Backoff\ExponentialBackoffStrategy; -use Guzzle\Plugin\Backoff\HttpBackoffStrategy; -use Guzzle\Plugin\Backoff\TruncatedBackoffStrategy; -use Guzzle\Service\Command\CommandInterface; -use Guzzle\Service\Command\Factory\AliasFactory; -use Guzzle\Service\Command\Factory\CompositeFactory; -use Guzzle\Service\Resource\Model; -use Guzzle\Service\Resource\ResourceIteratorInterface; - -/** - * Client to interact with Amazon Simple Storage Service - * - * @method S3SignatureInterface getSignature() Returns the signature implementation used with the client - * @method Model abortMultipartUpload(array $args = array()) {@command S3 AbortMultipartUpload} - * @method Model completeMultipartUpload(array $args = array()) {@command S3 CompleteMultipartUpload} - * @method Model copyObject(array $args = array()) {@command S3 CopyObject} - * @method Model createBucket(array $args = array()) {@command S3 CreateBucket} - * @method Model createMultipartUpload(array $args = array()) {@command S3 CreateMultipartUpload} - * @method Model deleteBucket(array $args = array()) {@command S3 DeleteBucket} - * @method Model deleteBucketCors(array $args = array()) {@command S3 DeleteBucketCors} - * @method Model deleteBucketLifecycle(array $args = array()) {@command S3 DeleteBucketLifecycle} - * @method Model deleteBucketPolicy(array $args = array()) {@command S3 DeleteBucketPolicy} - * @method Model deleteBucketTagging(array $args = array()) {@command S3 DeleteBucketTagging} - * @method Model deleteBucketWebsite(array $args = array()) {@command S3 DeleteBucketWebsite} - * @method Model deleteObject(array $args = array()) {@command S3 DeleteObject} - * @method Model deleteObjects(array $args = array()) {@command S3 DeleteObjects} - * @method Model getBucketAcl(array $args = array()) {@command S3 GetBucketAcl} - * @method Model getBucketCors(array $args = array()) {@command S3 GetBucketCors} - * @method Model getBucketLifecycle(array $args = array()) {@command S3 GetBucketLifecycle} - * @method Model getBucketLocation(array $args = array()) {@command S3 GetBucketLocation} - * @method Model getBucketLogging(array $args = array()) {@command S3 GetBucketLogging} - * @method Model getBucketNotification(array $args = array()) {@command S3 GetBucketNotification} - * @method Model getBucketPolicy(array $args = array()) {@command S3 GetBucketPolicy} - * @method Model getBucketRequestPayment(array $args = array()) {@command S3 GetBucketRequestPayment} - * @method Model getBucketTagging(array $args = array()) {@command S3 GetBucketTagging} - * @method Model getBucketVersioning(array $args = array()) {@command S3 GetBucketVersioning} - * @method Model getBucketWebsite(array $args = array()) {@command S3 GetBucketWebsite} - * @method Model getObject(array $args = array()) {@command S3 GetObject} - * @method Model getObjectAcl(array $args = array()) {@command S3 GetObjectAcl} - * @method Model getObjectTorrent(array $args = array()) {@command S3 GetObjectTorrent} - * @method Model headBucket(array $args = array()) {@command S3 HeadBucket} - * @method Model headObject(array $args = array()) {@command S3 HeadObject} - * @method Model listBuckets(array $args = array()) {@command S3 ListBuckets} - * @method Model listMultipartUploads(array $args = array()) {@command S3 ListMultipartUploads} - * @method Model listObjectVersions(array $args = array()) {@command S3 ListObjectVersions} - * @method Model listObjects(array $args = array()) {@command S3 ListObjects} - * @method Model listParts(array $args = array()) {@command S3 ListParts} - * @method Model putBucketAcl(array $args = array()) {@command S3 PutBucketAcl} - * @method Model putBucketCors(array $args = array()) {@command S3 PutBucketCors} - * @method Model putBucketLifecycle(array $args = array()) {@command S3 PutBucketLifecycle} - * @method Model putBucketLogging(array $args = array()) {@command S3 PutBucketLogging} - * @method Model putBucketNotification(array $args = array()) {@command S3 PutBucketNotification} - * @method Model putBucketPolicy(array $args = array()) {@command S3 PutBucketPolicy} - * @method Model putBucketRequestPayment(array $args = array()) {@command S3 PutBucketRequestPayment} - * @method Model putBucketTagging(array $args = array()) {@command S3 PutBucketTagging} - * @method Model putBucketVersioning(array $args = array()) {@command S3 PutBucketVersioning} - * @method Model putBucketWebsite(array $args = array()) {@command S3 PutBucketWebsite} - * @method Model putObject(array $args = array()) {@command S3 PutObject} - * @method Model putObjectAcl(array $args = array()) {@command S3 PutObjectAcl} - * @method Model restoreObject(array $args = array()) {@command S3 RestoreObject} - * @method Model uploadPart(array $args = array()) {@command S3 UploadPart} - * @method Model uploadPartCopy(array $args = array()) {@command S3 UploadPartCopy} - * @method waitUntilBucketExists(array $input) The input array uses the parameters of the HeadBucket operation and waiter specific settings - * @method waitUntilBucketNotExists(array $input) The input array uses the parameters of the HeadBucket operation and waiter specific settings - * @method waitUntilObjectExists(array $input) The input array uses the parameters of the HeadObject operation and waiter specific settings - * @method ResourceIteratorInterface getListBucketsIterator(array $args = array()) The input array uses the parameters of the ListBuckets operation - * @method ResourceIteratorInterface getListMultipartUploadsIterator(array $args = array()) The input array uses the parameters of the ListMultipartUploads operation - * @method ResourceIteratorInterface getListObjectVersionsIterator(array $args = array()) The input array uses the parameters of the ListObjectVersions operation - * @method ResourceIteratorInterface getListObjectsIterator(array $args = array()) The input array uses the parameters of the ListObjects operation - * @method ResourceIteratorInterface getListPartsIterator(array $args = array()) The input array uses the parameters of the ListParts operation - * - * @link http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-s3.html User guide - * @link http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.S3.S3Client.html API docs - */ -class S3Client extends AbstractClient -{ - const LATEST_API_VERSION = '2006-03-01'; - - /** - * @var array Aliases for S3 operations - */ - protected static $commandAliases = array( - // REST API Docs Aliases - 'GetService' => 'ListBuckets', - 'GetBucket' => 'ListObjects', - 'PutBucket' => 'CreateBucket', - - // SDK 1.x Aliases - 'GetBucketHeaders' => 'HeadBucket', - 'GetObjectHeaders' => 'HeadObject', - 'SetBucketAcl' => 'PutBucketAcl', - 'CreateObject' => 'PutObject', - 'DeleteObjects' => 'DeleteMultipleObjects', - 'PutObjectCopy' => 'CopyObject', - 'SetObjectAcl' => 'PutObjectAcl', - 'GetLogs' => 'GetBucketLogging', - 'GetVersioningStatus' => 'GetBucketVersioning', - 'SetBucketPolicy' => 'PutBucketPolicy', - 'CreateBucketNotification' => 'PutBucketNotification', - 'GetBucketNotifications' => 'GetBucketNotification', - 'CopyPart' => 'UploadPartCopy', - 'CreateWebsiteConfig' => 'PutBucketWebsite', - 'GetWebsiteConfig' => 'GetBucketWebsite', - 'DeleteWebsiteConfig' => 'DeleteBucketWebsite', - 'CreateObjectExpirationConfig' => 'PutBucketLifecycle', - 'GetObjectExpirationConfig' => 'GetBucketLifecycle', - 'DeleteObjectExpirationConfig' => 'DeleteBucketLifecycle', - ); - - protected $directory = __DIR__; - - /** - * Factory method to create a new Amazon S3 client using an array of configuration options. - * - * @param array|Collection $config Client configuration data - * - * @return S3Client - * @link http://docs.aws.amazon.com/aws-sdk-php/guide/latest/configuration.html#client-configuration-options - */ - public static function factory($config = array()) - { - $exceptionParser = new S3ExceptionParser(); - - // Configure the custom exponential backoff plugin for retrying S3 specific errors - if (!isset($config[Options::BACKOFF])) { - $config[Options::BACKOFF] = static::createBackoffPlugin($exceptionParser); - } - - $config[Options::SIGNATURE] = $signature = static::createSignature($config); - - $client = ClientBuilder::factory(__NAMESPACE__) - ->setConfig($config) - ->setConfigDefaults(array( - Options::VERSION => self::LATEST_API_VERSION, - Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/s3-%s.php' - )) - ->setExceptionParser($exceptionParser) - ->setIteratorsConfig(array( - 'more_key' => 'IsTruncated', - 'operations' => array( - 'ListBuckets', - 'ListMultipartUploads' => array( - 'limit_param' => 'MaxUploads', - 'token_param' => array('KeyMarker', 'UploadIdMarker'), - 'token_key' => array('NextKeyMarker', 'NextUploadIdMarker'), - ), - 'ListObjects' => array( - 'limit_param' => 'MaxKeys', - 'token_param' => 'Marker', - 'token_key' => 'NextMarker', - ), - 'ListObjectVersions' => array( - 'limit_param' => 'MaxKeys', - 'token_param' => array('KeyMarker', 'VersionIdMarker'), - 'token_key' => array('nextKeyMarker', 'nextVersionIdMarker'), - ), - 'ListParts' => array( - 'limit_param' => 'MaxParts', - 'result_key' => 'Parts', - 'token_param' => 'PartNumberMarker', - 'token_key' => 'NextPartNumberMarker', - ), - ) - )) - ->build(); - - // Use virtual hosted buckets when possible - $client->addSubscriber(new BucketStyleListener()); - // Ensure that ACP headers are applied when needed - $client->addSubscriber(new AcpListener()); - // Validate and add required Content-MD5 hashes (e.g. DeleteObjects) - $client->addSubscriber(new S3Md5Listener($signature)); - - // Allow for specifying bodies with file paths and file handles - $client->addSubscriber(new UploadBodyListener(array('PutObject', 'UploadPart'))); - - // Ensures that if a SSE-CPK key is provided, the key and md5 are formatted correctly - $client->addSubscriber(new SseCpkListener); - - // Add aliases for some S3 operations - $default = CompositeFactory::getDefaultChain($client); - $default->add( - new AliasFactory($client, static::$commandAliases), - 'Guzzle\Service\Command\Factory\ServiceDescriptionFactory' - ); - $client->setCommandFactory($default); - - return $client; - } - - /** - * Create an Amazon S3 specific backoff plugin - * - * @param S3ExceptionParser $exceptionParser - * - * @return BackoffPlugin - */ - private static function createBackoffPlugin(S3ExceptionParser $exceptionParser) - { - return new BackoffPlugin( - new TruncatedBackoffStrategy(3, - new CurlBackoffStrategy(null, - new HttpBackoffStrategy(null, - new SocketTimeoutChecker( - new ExpiredCredentialsChecker($exceptionParser, - new ExponentialBackoffStrategy() - ) - ) - ) - ) - ) - ); - } - - /** - * Create an appropriate signature based on the configuration settings - * - * @param $config - * - * @return \Aws\Common\Signature\SignatureInterface - * @throws InvalidArgumentException - */ - private static function createSignature($config) - { - $currentValue = isset($config[Options::SIGNATURE]) ? $config[Options::SIGNATURE] : null; - - // Force v4 if no value is provided, a region is in the config, and - // the region starts with "cn-" or "eu-central-". - $requiresV4 = !$currentValue - && isset($config['region']) - && (strpos($config['region'], 'eu-central-') === 0 - || strpos($config['region'], 'cn-') === 0); - - // Use the Amazon S3 signature V4 when the value is set to "v4" or when - // the value is not set and the region starts with "cn-". - if ($currentValue == 'v4' || $requiresV4) { - // Force SignatureV4 for specific regions or if specified in the config - $currentValue = new S3SignatureV4('s3'); - } elseif (!$currentValue || $currentValue == 's3') { - // Use the Amazon S3 signature by default - $currentValue = new S3Signature(); - } - - // A region is require with v4 - if ($currentValue instanceof SignatureV4 && !isset($config['region'])) { - throw new InvalidArgumentException('A region must be specified ' - . 'when using signature version 4'); - } - - return $currentValue; - } - - /** - * Determine if a string is a valid name for a DNS compatible Amazon S3 - * bucket, meaning the bucket can be used as a subdomain in a URL (e.g., - * "<bucket>.s3.amazonaws.com"). - * - * @param string $bucket The name of the bucket to check. - * - * @return bool TRUE if the bucket name is valid or FALSE if it is invalid. - */ - public static function isValidBucketName($bucket) - { - $bucketLen = strlen($bucket); - if ($bucketLen < 3 || $bucketLen > 63 || - // Cannot look like an IP address - preg_match('/(\d+\.){3}\d+$/', $bucket) || - // Cannot include special characters, must start and end with lower alnum - !preg_match('/^[a-z0-9]([a-z0-9\-\.]*[a-z0-9])?$/', $bucket) - ) { - return false; - } - - return true; - } - - /** - * Create a pre-signed URL for a request - * - * @param RequestInterface $request Request to generate the URL for. Use the factory methods of the client to - * create this request object - * @param int|string|\DateTime $expires The time at which the URL should expire. This can be a Unix timestamp, a - * PHP DateTime object, or a string that can be evaluated by strtotime - * - * @return string - * @throws InvalidArgumentException if the request is not associated with this client object - */ - public function createPresignedUrl(RequestInterface $request, $expires) - { - if ($request->getClient() !== $this) { - throw new InvalidArgumentException('The request object must be associated with the client. Use the ' - . '$client->get(), $client->head(), $client->post(), $client->put(), etc. methods when passing in a ' - . 'request object'); - } - - return $this->signature->createPresignedUrl($request, $this->credentials, $expires); - } - - /** - * Returns the URL to an object identified by its bucket and key. If an expiration time is provided, the URL will - * be signed and set to expire at the provided time. - * - * @param string $bucket The name of the bucket where the object is located - * @param string $key The key of the object - * @param mixed $expires The time at which the URL should expire - * @param array $args Arguments to the GetObject command. Additionally you can specify a "Scheme" if you would - * like the URL to use a different scheme than what the client is configured to use - * - * @return string The URL to the object - */ - public function getObjectUrl($bucket, $key, $expires = null, array $args = array()) - { - $command = $this->getCommand('GetObject', $args + array('Bucket' => $bucket, 'Key' => $key)); - - if ($command->hasKey('Scheme')) { - $scheme = $command['Scheme']; - $request = $command->remove('Scheme')->prepare()->setScheme($scheme)->setPort(null); - } else { - $request = $command->prepare(); - } - - return $expires ? $this->createPresignedUrl($request, $expires) : $request->getUrl(); - } - - /** - * Helper used to clear the contents of a bucket. Use the {@see ClearBucket} object directly - * for more advanced options and control. - * - * @param string $bucket Name of the bucket to clear. - * - * @return int Returns the number of deleted keys - */ - public function clearBucket($bucket) - { - $clear = new ClearBucket($this, $bucket); - - return $clear->clear(); - } - - /** - * Determines whether or not a bucket exists by name - * - * @param string $bucket The name of the bucket - * @param bool $accept403 Set to true if 403s are acceptable - * @param array $options Additional options to add to the executed command - * - * @return bool - */ - public function doesBucketExist($bucket, $accept403 = true, array $options = array()) - { - return $this->checkExistenceWithCommand( - $this->getCommand('HeadBucket', array_merge($options, array( - 'Bucket' => $bucket - ))), $accept403 - ); - } - - /** - * Determines whether or not an object exists by name - * - * @param string $bucket The name of the bucket - * @param string $key The key of the object - * @param array $options Additional options to add to the executed command - * - * @return bool - */ - public function doesObjectExist($bucket, $key, array $options = array()) - { - return $this->checkExistenceWithCommand( - $this->getCommand('HeadObject', array_merge($options, array( - 'Bucket' => $bucket, - 'Key' => $key - ))) - ); - } - - /** - * Determines whether or not a bucket policy exists for a bucket - * - * @param string $bucket The name of the bucket - * @param array $options Additional options to add to the executed command - * - * @return bool - */ - public function doesBucketPolicyExist($bucket, array $options = array()) - { - return $this->checkExistenceWithCommand( - $this->getCommand('GetBucketPolicy', array_merge($options, array( - 'Bucket' => $bucket - ))) - ); - } - - /** - * Raw URL encode a key and allow for '/' characters - * - * @param string $key Key to encode - * - * @return string Returns the encoded key - */ - public static function encodeKey($key) - { - return str_replace('%2F', '/', rawurlencode($key)); - } - - /** - * Explode a prefixed key into an array of values - * - * @param string $key Key to explode - * - * @return array Returns the exploded - */ - public static function explodeKey($key) - { - // Remove a leading slash if one is found - return explode('/', $key && $key[0] == '/' ? substr($key, 1) : $key); - } - - /** - * Register the Amazon S3 stream wrapper and associates it with this client object - * - * @return $this - */ - public function registerStreamWrapper() - { - StreamWrapper::register($this); - - return $this; - } - - /** - * Upload a file, stream, or string to a bucket. If the upload size exceeds the specified threshold, the upload - * will be performed using parallel multipart uploads. - * - * @param string $bucket Bucket to upload the object - * @param string $key Key of the object - * @param mixed $body Object data to upload. Can be a Guzzle\Http\EntityBodyInterface, stream resource, or - * string of data to upload. - * @param string $acl ACL to apply to the object - * @param array $options Custom options used when executing commands: - * - params: Custom parameters to use with the upload. The parameters must map to a PutObject - * or InitiateMultipartUpload operation parameters. - * - min_part_size: Minimum size to allow for each uploaded part when performing a multipart upload. - * - concurrency: Maximum number of concurrent multipart uploads. - * - before_upload: Callback to invoke before each multipart upload. The callback will receive a - * Guzzle\Common\Event object with context. - * - * @see Aws\S3\Model\MultipartUpload\UploadBuilder for more options and customization - * @return \Guzzle\Service\Resource\Model Returns the modeled result of the performed operation - */ - public function upload($bucket, $key, $body, $acl = 'private', array $options = array()) - { - $body = EntityBody::factory($body); - $options = Collection::fromConfig(array_change_key_case($options), array( - 'min_part_size' => AbstractMulti::MIN_PART_SIZE, - 'params' => array(), - 'concurrency' => $body->getWrapper() == 'plainfile' ? 3 : 1 - )); - - if ($body->getSize() < $options['min_part_size']) { - // Perform a simple PutObject operation - return $this->putObject(array( - 'Bucket' => $bucket, - 'Key' => $key, - 'Body' => $body, - 'ACL' => $acl - ) + $options['params']); - } - - // Perform a multipart upload if the file is large enough - $transfer = UploadBuilder::newInstance() - ->setBucket($bucket) - ->setKey($key) - ->setMinPartSize($options['min_part_size']) - ->setConcurrency($options['concurrency']) - ->setClient($this) - ->setSource($body) - ->setTransferOptions($options->toArray()) - ->addOptions($options['params']) - ->setOption('ACL', $acl) - ->build(); - - if ($options['before_upload']) { - $transfer->getEventDispatcher()->addListener( - AbstractTransfer::BEFORE_PART_UPLOAD, - $options['before_upload'] - ); - } - - return $transfer->upload(); - } - - /** - * Recursively uploads all files in a given directory to a given bucket. - * - * @param string $directory Full path to a directory to upload - * @param string $bucket Name of the bucket - * @param string $keyPrefix Virtual directory key prefix to add to each upload - * @param array $options Associative array of upload options - * - params: Array of parameters to use with each PutObject operation performed during the transfer - * - base_dir: Base directory to remove from each object key - * - force: Set to true to upload every file, even if the file is already in Amazon S3 and has not changed - * - concurrency: Maximum number of parallel uploads (defaults to 10) - * - debug: Set to true or an fopen resource to enable debug mode to print information about each upload - * - multipart_upload_size: When the size of a file exceeds this value, the file will be uploaded using a - * multipart upload. - * - * @see Aws\S3\S3Sync\S3Sync for more options and customization - */ - public function uploadDirectory($directory, $bucket, $keyPrefix = null, array $options = array()) - { - $options = Collection::fromConfig( - $options, - array( - 'base_dir' => realpath($directory) ?: $directory - ) - ); - - $builder = $options['builder'] ?: UploadSyncBuilder::getInstance(); - $builder->uploadFromDirectory($directory) - ->setClient($this) - ->setBucket($bucket) - ->setKeyPrefix($keyPrefix) - ->setConcurrency($options['concurrency'] ?: 5) - ->setBaseDir($options['base_dir']) - ->force($options['force']) - ->setOperationParams($options['params'] ?: array()) - ->enableDebugOutput($options['debug']); - - if ($options->hasKey('multipart_upload_size')) { - $builder->setMultipartUploadSize($options['multipart_upload_size']); - } - - $builder->build()->transfer(); - } - - /** - * Downloads a bucket to the local filesystem - * - * @param string $directory Directory to download to - * @param string $bucket Bucket to download from - * @param string $keyPrefix Only download objects that use this key prefix - * @param array $options Associative array of download options - * - params: Array of parameters to use with each GetObject operation performed during the transfer - * - base_dir: Base directory to remove from each object key when storing in the local filesystem - * - force: Set to true to download every file, even if the file is already on the local filesystem and has not - * changed - * - concurrency: Maximum number of parallel downloads (defaults to 10) - * - debug: Set to true or a fopen resource to enable debug mode to print information about each download - * - allow_resumable: Set to true to allow previously interrupted downloads to be resumed using a Range GET - */ - public function downloadBucket($directory, $bucket, $keyPrefix = '', array $options = array()) - { - $options = new Collection($options); - $builder = $options['builder'] ?: DownloadSyncBuilder::getInstance(); - $builder->setDirectory($directory) - ->setClient($this) - ->setBucket($bucket) - ->setKeyPrefix($keyPrefix) - ->setConcurrency($options['concurrency'] ?: 10) - ->setBaseDir($options['base_dir']) - ->force($options['force']) - ->setOperationParams($options['params'] ?: array()) - ->enableDebugOutput($options['debug']); - - if ($options['allow_resumable']) { - $builder->allowResumableDownloads(); - } - - $builder->build()->transfer(); - } - - /** - * Deletes objects from Amazon S3 that match the result of a ListObjects operation. For example, this allows you - * to do things like delete all objects that match a specific key prefix. - * - * @param string $bucket Bucket that contains the object keys - * @param string $prefix Optionally delete only objects under this key prefix - * @param string $regex Delete only objects that match this regex - * @param array $options Options used when deleting the object: - * - before_delete: Callback to invoke before each delete. The callback will receive a - * Guzzle\Common\Event object with context. - * - * @see Aws\S3\S3Client::listObjects - * @see Aws\S3\Model\ClearBucket For more options or customization - * @return int Returns the number of deleted keys - * @throws RuntimeException if no prefix and no regex is given - */ - public function deleteMatchingObjects($bucket, $prefix = '', $regex = '', array $options = array()) - { - if (!$prefix && !$regex) { - throw new RuntimeException('A prefix or regex is required, or use S3Client::clearBucket().'); - } - - $clear = new ClearBucket($this, $bucket); - $iterator = $this->getIterator('ListObjects', array('Bucket' => $bucket, 'Prefix' => $prefix)); - - if ($regex) { - $iterator = new FilterIterator($iterator, function ($current) use ($regex) { - return preg_match($regex, $current['Key']); - }); - } - - $clear->setIterator($iterator); - if (isset($options['before_delete'])) { - $clear->getEventDispatcher()->addListener(ClearBucket::BEFORE_CLEAR, $options['before_delete']); - } - - return $clear->clear(); - } - - /** - * Determines whether or not a resource exists using a command - * - * @param CommandInterface $command Command used to poll for the resource - * @param bool $accept403 Set to true if 403s are acceptable - * - * @return bool - * @throws S3Exception|\Exception if there is an unhandled exception - */ - protected function checkExistenceWithCommand(CommandInterface $command, $accept403 = false) - { - try { - $command->execute(); - $exists = true; - } catch (AccessDeniedException $e) { - $exists = (bool) $accept403; - } catch (S3Exception $e) { - $exists = false; - if ($e->getResponse()->getStatusCode() >= 500) { - // @codeCoverageIgnoreStart - throw $e; - // @codeCoverageIgnoreEnd - } - } - - return $exists; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3Md5Listener.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3Md5Listener.php deleted file mode 100644 index 7558c477c25..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3Md5Listener.php +++ /dev/null @@ -1,73 +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; - -use Aws\Common\Signature\SignatureV4; -use Aws\Common\Signature\SignatureInterface; -use Guzzle\Common\Event; -use Guzzle\Service\Command\CommandInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * Adds required and optional Content-MD5 headers - */ -class S3Md5Listener implements EventSubscriberInterface -{ - /** @var S3SignatureInterface */ - private $signature; - - public static function getSubscribedEvents() - { - return array('command.after_prepare' => 'onCommandAfterPrepare'); - } - - public function __construct(SignatureInterface $signature) - { - $this->signature = $signature; - } - - public function onCommandAfterPrepare(Event $event) - { - $command = $event['command']; - $operation = $command->getOperation(); - - if ($operation->getData('contentMd5')) { - // Add the MD5 if it is required for all signers - $this->addMd5($command); - } elseif ($operation->hasParam('ContentMD5')) { - $value = $command['ContentMD5']; - // Add a computed MD5 if the parameter is set to true or if - // not using Signature V4 and the value is not set (null). - if ($value === true || - ($value === null && !($this->signature instanceof SignatureV4)) - ) { - $this->addMd5($command); - } - } - } - - private function addMd5(CommandInterface $command) - { - $request = $command->getRequest(); - $body = $request->getBody(); - if ($body && $body->getSize() > 0) { - if (false !== ($md5 = $body->getContentMd5(true, true))) { - $request->setHeader('Content-MD5', $md5); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3Signature.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3Signature.php deleted file mode 100644 index 4dcc2a8bdf8..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3Signature.php +++ /dev/null @@ -1,268 +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; - -use Aws\Common\Credentials\CredentialsInterface; -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\QueryString; -use Guzzle\Http\Url; - -/** - * Default Amazon S3 signature implementation - * @link http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html - */ -class S3Signature implements S3SignatureInterface -{ - /** - * @var array Query string values that must be signed - */ - protected $signableQueryString = array ( - 'acl', - 'cors', - 'delete', - 'lifecycle', - 'location', - 'logging', - 'notification', - 'partNumber', - 'policy', - 'requestPayment', - 'response-cache-control', - 'response-content-disposition', - 'response-content-encoding', - 'response-content-language', - 'response-content-type', - 'response-expires', - 'restore', - 'tagging', - 'torrent', - 'uploadId', - 'uploads', - 'versionId', - 'versioning', - 'versions', - 'website', - ); - - /** @var array Sorted headers that must be signed */ - private $signableHeaders = array('Content-MD5', 'Content-Type'); - - public function signRequest(RequestInterface $request, CredentialsInterface $credentials) - { - // Ensure that the signable query string parameters are sorted - sort($this->signableQueryString); - - // Add the security token header if one is being used by the credentials - if ($token = $credentials->getSecurityToken()) { - $request->setHeader('x-amz-security-token', $token); - } - - // Add a date header if one is not set - if (!$request->hasHeader('date') && !$request->hasHeader('x-amz-date')) { - $request->setHeader('Date', gmdate(\DateTime::RFC2822)); - } - - $stringToSign = $this->createCanonicalizedString($request); - $request->getParams()->set('aws.string_to_sign', $stringToSign); - - $request->setHeader( - 'Authorization', - 'AWS ' . $credentials->getAccessKeyId() . ':' . $this->signString($stringToSign, $credentials) - ); - } - - public function createPresignedUrl( - RequestInterface $request, - CredentialsInterface $credentials, - $expires - ) { - if ($expires instanceof \DateTime) { - $expires = $expires->getTimestamp(); - } elseif (!is_numeric($expires)) { - $expires = strtotime($expires); - } - - // Operate on a clone of the request, so the original is not altered - $request = clone $request; - - // URL encoding already occurs in the URI template expansion. Undo that and encode using the same encoding as - // GET object, PUT object, etc. - $path = S3Client::encodeKey(rawurldecode($request->getPath())); - $request->setPath($path); - - // Make sure to handle temporary credentials - if ($token = $credentials->getSecurityToken()) { - $request->setHeader('x-amz-security-token', $token); - $request->getQuery()->set('x-amz-security-token', $token); - } - - // Set query params required for pre-signed URLs - $request->getQuery() - ->set('AWSAccessKeyId', $credentials->getAccessKeyId()) - ->set('Expires', $expires) - ->set('Signature', $this->signString( - $this->createCanonicalizedString($request, $expires), - $credentials - )); - - // Move X-Amz-* headers to the query string - foreach ($request->getHeaders() as $name => $header) { - $name = strtolower($name); - if (strpos($name, 'x-amz-') === 0) { - $request->getQuery()->set($name, (string) $header); - $request->removeHeader($name); - } - } - - return $request->getUrl(); - } - - public function signString($string, CredentialsInterface $credentials) - { - return base64_encode(hash_hmac('sha1', $string, $credentials->getSecretKey(), true)); - } - - public function createCanonicalizedString(RequestInterface $request, $expires = null) - { - $buffer = $request->getMethod() . "\n"; - - // Add the interesting headers - foreach ($this->signableHeaders as $header) { - $buffer .= (string) $request->getHeader($header) . "\n"; - } - - // Choose dates from left to right based on what's set - $date = $expires ?: (string) $request->getHeader('date'); - - $buffer .= "{$date}\n" - . $this->createCanonicalizedAmzHeaders($request) - . $this->createCanonicalizedResource($request); - - return $buffer; - } - - /** - * Create a canonicalized AmzHeaders string for a signature. - * - * @param RequestInterface $request Request from which to gather headers - * - * @return string Returns canonicalized AMZ headers. - */ - private function createCanonicalizedAmzHeaders(RequestInterface $request) - { - $headers = array(); - foreach ($request->getHeaders() as $name => $header) { - $name = strtolower($name); - if (strpos($name, 'x-amz-') === 0) { - $value = trim((string) $header); - if ($value || $value === '0') { - $headers[$name] = $name . ':' . $value; - } - } - } - - if (!$headers) { - return ''; - } - - ksort($headers); - - return implode("\n", $headers) . "\n"; - } - - /** - * Create a canonicalized resource for a request - * - * @param RequestInterface $request Request for the resource - * - * @return string - */ - private function createCanonicalizedResource(RequestInterface $request) - { - $buffer = $request->getParams()->get('s3.resource'); - // When sending a raw HTTP request (e.g. $client->get()) - if (null === $buffer) { - $bucket = $request->getParams()->get('bucket') ?: $this->parseBucketName($request); - // Use any specified bucket name, the parsed bucket name, or no bucket name when interacting with GetService - $buffer = $bucket ? "/{$bucket}" : ''; - // Remove encoding from the path and use the S3 specific encoding - $path = S3Client::encodeKey(rawurldecode($request->getPath())); - // if the bucket was path style, then ensure that the bucket wasn't duplicated in the resource - $buffer .= preg_replace("#^/{$bucket}/{$bucket}#", "/{$bucket}", $path); - } - - // Remove double slashes - $buffer = str_replace('//', '/', $buffer); - - // Add sub resource parameters - $query = $request->getQuery(); - $first = true; - foreach ($this->signableQueryString as $key) { - if ($query->hasKey($key)) { - $value = $query[$key]; - $buffer .= $first ? '?' : '&'; - $first = false; - $buffer .= $key; - // Don't add values for empty sub-resources - if ($value !== '' && - $value !== false && - $value !== null && - $value !== QueryString::BLANK - ) { - $buffer .= "={$value}"; - } - } - } - - return $buffer; - } - - /** - * Parse the bucket name from a request object - * - * @param RequestInterface $request Request to parse - * - * @return string - */ - private function parseBucketName(RequestInterface $request) - { - $baseUrl = Url::factory($request->getClient()->getBaseUrl()); - $baseHost = $baseUrl->getHost(); - $host = $request->getHost(); - - if (strpos($host, $baseHost) === false) { - // Does not contain the base URL, so it's either a redirect, CNAME, or using a different region - $baseHost = ''; - // For every known S3 host, check if that host is present on the request - $regions = $request->getClient()->getDescription()->getData('regions'); - foreach ($regions as $region) { - if (strpos($host, $region['hostname']) !== false) { - // This host matches the request host. Tells use the region and endpoint-- we can derive the bucket - $baseHost = $region['hostname']; - break; - } - } - // If no matching base URL was found, then assume that this is a CNAME, and the CNAME is the bucket - if (!$baseHost) { - return $host; - } - } - - // Remove the baseURL from the host of the request to attempt to determine the bucket name - return trim(str_replace($baseHost, '', $request->getHost()), ' .'); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3SignatureInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3SignatureInterface.php deleted file mode 100644 index 0b7e940acb6..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3SignatureInterface.php +++ /dev/null @@ -1,24 +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; - -use Aws\Common\Signature\SignatureInterface; - -/** - * @deprecated - */ -interface S3SignatureInterface extends SignatureInterface {} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3SignatureV4.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3SignatureV4.php deleted file mode 100644 index edbb4fcd082..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/S3SignatureV4.php +++ /dev/null @@ -1,60 +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; - -use Aws\Common\Signature\SignatureV4; -use Aws\Common\Credentials\CredentialsInterface; -use Guzzle\Http\Message\EntityEnclosingRequestInterface; -use Guzzle\Http\Message\RequestInterface; - -/** - * Amazon S3 signature version 4 overrides. - */ -class S3SignatureV4 extends SignatureV4 implements S3SignatureInterface -{ - /** - * Always add a x-amz-content-sha-256 for data integrity. - */ - public function signRequest(RequestInterface $request, CredentialsInterface $credentials) - { - if (!$request->hasHeader('x-amz-content-sha256')) { - $request->setHeader( - 'x-amz-content-sha256', - $this->getPayload($request) - ); - } - - parent::signRequest($request, $credentials); - } - - /** - * Override used to allow pre-signed URLs to be created for an - * in-determinate request payload. - */ - protected function getPresignedPayload(RequestInterface $request) - { - return 'UNSIGNED-PAYLOAD'; - } - - /** - * Amazon S3 does not double-encode the path component in the canonical req - */ - protected function createCanonicalizedPath(RequestInterface $request) - { - return '/' . ltrim($request->getPath(), '/'); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/SocketTimeoutChecker.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/SocketTimeoutChecker.php deleted file mode 100644 index ede2b960418..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/SocketTimeoutChecker.php +++ /dev/null @@ -1,71 +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; - -use Guzzle\Http\Exception\HttpException; -use Guzzle\Http\Message\RequestInterface; -use Guzzle\Http\Message\EntityEnclosingRequestInterface; -use Guzzle\Http\Message\Response; -use Guzzle\Plugin\Backoff\BackoffStrategyInterface; -use Guzzle\Plugin\Backoff\AbstractBackoffStrategy; - -/** - * Custom S3 exponential backoff checking use to retry 400 responses containing the following reason phrase: - * "Your socket connection to the server was not read from or written to within the timeout period.". - * This error has been reported as intermittent/random, and in most cases, seems to occur during the middle of a - * transfer. This plugin will attempt to retry these failed requests, and if using a local file, will clear the - * stat cache of the file and set a new content-length header on the upload. - */ -class SocketTimeoutChecker extends AbstractBackoffStrategy -{ - const ERR = 'Your socket connection to the server was not read from or written to within the timeout period'; - - /** - * {@inheridoc} - */ - public function __construct(BackoffStrategyInterface $next = null) - { - if ($next) { - $this->setNext($next); - } - } - - /** - * {@inheridoc} - */ - public function makesDecision() - { - return true; - } - - /** - * {@inheritdoc} - */ - protected function getDelay( - $retries, - RequestInterface $request, - Response $response = null, - HttpException $e = null - ) { - if ($response - && $response->getStatusCode() == 400 - && strpos($response->getBody(), self::ERR) - ) { - return true; - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/SseCpkListener.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/SseCpkListener.php deleted file mode 100644 index c1a9260383a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/SseCpkListener.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -namespace Aws\S3; - -use Aws\Common\Exception\RuntimeException; -use Guzzle\Common\Event; -use Guzzle\Service\Command\CommandInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * This listener simplifies the SSE-C process by encoding and hashing the key. - */ -class SseCpkListener implements EventSubscriberInterface -{ - public static function getSubscribedEvents() - { - return array('command.before_prepare' => 'onCommandBeforePrepare'); - } - - public function onCommandBeforePrepare(Event $event) - { - /** @var CommandInterface $command */ - $command = $event['command']; - - // Allows only HTTPS connections when using SSE-C - if ($command['SSECustomerKey'] || - $command['CopySourceSSECustomerKey'] - ) { - $this->validateScheme($command); - } - - // Prepare the normal SSE-CPK headers - if ($command['SSECustomerKey']) { - $this->prepareSseParams($command); - } - - // If it's a copy operation, prepare the SSE-CPK headers for the source. - if ($command['CopySourceSSECustomerKey']) { - $this->prepareSseParams($command, true); - } - } - - private function validateScheme(CommandInterface $command) - { - if ($command->getClient()->getConfig('scheme') !== 'https') { - throw new RuntimeException('You must configure your S3 client to ' - . 'use HTTPS in order to use the SSE-C features.'); - } - } - - private function prepareSseParams( - CommandInterface $command, - $isCopy = false - ) { - $prefix = $isCopy ? 'CopySource' : ''; - - // Base64 encode the provided key - $key = $command[$prefix . 'SSECustomerKey']; - $command[$prefix . 'SSECustomerKey'] = base64_encode($key); - - // Base64 the provided MD5 or, generate an MD5 if not provided - if ($md5 = $command[$prefix . 'SSECustomerKeyMD5']) { - $command[$prefix . 'SSECustomerKeyMD5'] = base64_encode($md5); - } else { - $command[$prefix . 'SSECustomerKeyMD5'] = base64_encode(md5($key, true)); - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/StreamWrapper.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/StreamWrapper.php deleted file mode 100644 index b0bdb21f564..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/StreamWrapper.php +++ /dev/null @@ -1,891 +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; - -use Aws\Common\Exception\RuntimeException; -use Aws\S3\Exception\S3Exception; -use Aws\S3\Exception\NoSuchKeyException; -use Aws\S3\Iterator\ListObjectsIterator; -use Guzzle\Http\EntityBody; -use Guzzle\Http\CachingEntityBody; -use Guzzle\Http\Mimetypes; -use Guzzle\Iterator\FilterIterator; -use Guzzle\Stream\PhpStreamRequestFactory; -use Guzzle\Service\Command\CommandInterface; - -/** - * Amazon S3 stream wrapper to use "s3://<bucket>/<key>" files with PHP streams, supporting "r", "w", "a", "x". - * - * # Supported stream related PHP functions: - * - fopen, fclose, fread, fwrite, fseek, ftell, feof, fflush - * - opendir, closedir, readdir, rewinddir - * - copy, rename, unlink - * - mkdir, rmdir, rmdir (recursive) - * - file_get_contents, file_put_contents - * - file_exists, filesize, is_file, is_dir - * - * # Opening "r" (read only) streams: - * - * Read only streams are truly streaming by default and will not allow you to seek. This is because data - * read from the stream is not kept in memory or on the local filesystem. You can force a "r" stream to be seekable - * by setting the "seekable" stream context option true. This will allow true streaming of data from Amazon S3, but - * will maintain a buffer of previously read bytes in a 'php://temp' stream to allow seeking to previously read bytes - * from the stream. - * - * You may pass any GetObject parameters as 's3' stream context options. These options will affect how the data is - * downloaded from Amazon S3. - * - * # Opening "w" and "x" (write only) streams: - * - * Because Amazon S3 requires a Content-Length header, write only streams will maintain a 'php://temp' stream to buffer - * data written to the stream until the stream is flushed (usually by closing the stream with fclose). - * - * You may pass any PutObject parameters as 's3' stream context options. These options will affect how the data is - * uploaded to Amazon S3. - * - * When opening an "x" stream, the file must exist on Amazon S3 for the stream to open successfully. - * - * # Opening "a" (write only append) streams: - * - * Similar to "w" streams, opening append streams requires that the data be buffered in a "php://temp" stream. Append - * streams will attempt to download the contents of an object in Amazon S3, seek to the end of the object, then allow - * you to append to the contents of the object. The data will then be uploaded using a PutObject operation when the - * stream is flushed (usually with fclose). - * - * You may pass any GetObject and/or PutObject parameters as 's3' stream context options. These options will affect how - * the data is downloaded and uploaded from Amazon S3. - * - * Stream context options: - * - * - "seekable": Set to true to create a seekable "r" (read only) stream by using a php://temp stream buffer - * - For "unlink" only: Any option that can be passed to the DeleteObject operation - */ -class StreamWrapper -{ - /** - * @var resource|null Stream context (this is set by PHP when a context is used) - */ - public $context; - - /** - * @var S3Client Client used to send requests - */ - protected static $client; - - /** - * @var string Mode the stream was opened with - */ - protected $mode; - - /** - * @var EntityBody Underlying stream resource - */ - protected $body; - - /** - * @var array Current parameters to use with the flush operation - */ - protected $params; - - /** - * @var ListObjectsIterator Iterator used with opendir() and subsequent readdir() calls - */ - protected $objectIterator; - - /** - * @var string The bucket that was opened when opendir() was called - */ - protected $openedBucket; - - /** - * @var string The prefix of the bucket that was opened with opendir() - */ - protected $openedBucketPrefix; - - /** - * @var array The next key to retrieve when using a directory iterator. Helps for fast directory traversal. - */ - protected static $nextStat = array(); - - /** - * Register the 's3://' stream wrapper - * - * @param S3Client $client Client to use with the stream wrapper - */ - public static function register(S3Client $client) - { - if (in_array('s3', stream_get_wrappers())) { - stream_wrapper_unregister('s3'); - } - - stream_wrapper_register('s3', get_called_class(), STREAM_IS_URL); - static::$client = $client; - } - - /** - * Close the stream - */ - public function stream_close() - { - $this->body = null; - } - - /** - * @param string $path - * @param string $mode - * @param int $options - * @param string $opened_path - * - * @return bool - */ - public function stream_open($path, $mode, $options, &$opened_path) - { - // We don't care about the binary flag - $this->mode = $mode = rtrim($mode, 'bt'); - $this->params = $params = $this->getParams($path); - $errors = array(); - - if (!$params['Key']) { - $errors[] = 'Cannot open a bucket. You must specify a path in the form of s3://bucket/key'; - } - - if (strpos($mode, '+')) { - $errors[] = 'The Amazon S3 stream wrapper does not allow simultaneous reading and writing.'; - } - - if (!in_array($mode, array('r', 'w', 'a', 'x'))) { - $errors[] = "Mode not supported: {$mode}. Use one 'r', 'w', 'a', or 'x'."; - } - - // When using mode "x" validate if the file exists before attempting to read - if ($mode == 'x' && static::$client->doesObjectExist($params['Bucket'], $params['Key'], $this->getOptions())) { - $errors[] = "{$path} already exists on Amazon S3"; - } - - if (!$errors) { - if ($mode == 'r') { - $this->openReadStream($params, $errors); - } elseif ($mode == 'a') { - $this->openAppendStream($params, $errors); - } else { - $this->openWriteStream($params, $errors); - } - } - - return $errors ? $this->triggerError($errors) : true; - } - - /** - * @return bool - */ - public function stream_eof() - { - return $this->body->feof(); - } - - /** - * @return bool - */ - public function stream_flush() - { - if ($this->mode == 'r') { - return false; - } - - $this->body->rewind(); - $params = $this->params; - $params['Body'] = $this->body; - - // Attempt to guess the ContentType of the upload based on the - // file extension of the key - if (!isset($params['ContentType']) && - ($type = Mimetypes::getInstance()->fromFilename($params['Key'])) - ) { - $params['ContentType'] = $type; - } - - try { - static::$client->putObject($params); - return true; - } catch (\Exception $e) { - return $this->triggerError($e->getMessage()); - } - } - - /** - * Read data from the underlying stream - * - * @param int $count Amount of bytes to read - * - * @return string - */ - public function stream_read($count) - { - return $this->body->read($count); - } - - /** - * Seek to a specific byte in the stream - * - * @param int $offset Seek offset - * @param int $whence Whence (SEEK_SET, SEEK_CUR, SEEK_END) - * - * @return bool - */ - public function stream_seek($offset, $whence = SEEK_SET) - { - return $this->body->seek($offset, $whence); - } - - /** - * Get the current position of the stream - * - * @return int Returns the current position in the stream - */ - public function stream_tell() - { - return $this->body->ftell(); - } - - /** - * Write data the to the stream - * - * @param string $data - * - * @return int Returns the number of bytes written to the stream - */ - public function stream_write($data) - { - return $this->body->write($data); - } - - /** - * Delete a specific object - * - * @param string $path - * @return bool - */ - public function unlink($path) - { - try { - $this->clearStatInfo($path); - static::$client->deleteObject($this->getParams($path)); - return true; - } catch (\Exception $e) { - return $this->triggerError($e->getMessage()); - } - } - - /** - * @return array - */ - public function stream_stat() - { - $stat = fstat($this->body->getStream()); - // Add the size of the underlying stream if it is known - if ($this->mode == 'r' && $this->body->getSize()) { - $stat[7] = $stat['size'] = $this->body->getSize(); - } - - return $stat; - } - - /** - * Provides information for is_dir, is_file, filesize, etc. Works on buckets, keys, and prefixes - * - * @param string $path - * @param int $flags - * - * @return array Returns an array of stat data - * @link http://www.php.net/manual/en/streamwrapper.url-stat.php - */ - public function url_stat($path, $flags) - { - // Check if this path is in the url_stat cache - if (isset(static::$nextStat[$path])) { - return static::$nextStat[$path]; - } - - $parts = $this->getParams($path); - - if (!$parts['Key']) { - // Stat "directories": buckets, or "s3://" - if (!$parts['Bucket'] || static::$client->doesBucketExist($parts['Bucket'])) { - return $this->formatUrlStat($path); - } else { - return $this->triggerError("File or directory not found: {$path}", $flags); - } - } - - try { - try { - $result = static::$client->headObject($parts)->toArray(); - if (substr($parts['Key'], -1, 1) == '/' && $result['ContentLength'] == 0) { - // Return as if it is a bucket to account for console bucket objects (e.g., zero-byte object "foo/") - return $this->formatUrlStat($path); - } else { - // Attempt to stat and cache regular object - return $this->formatUrlStat($result); - } - } catch (NoSuchKeyException $e) { - // Maybe this isn't an actual key, but a prefix. Do a prefix listing of objects to determine. - $result = static::$client->listObjects(array( - 'Bucket' => $parts['Bucket'], - 'Prefix' => rtrim($parts['Key'], '/') . '/', - 'MaxKeys' => 1 - )); - if (!$result['Contents'] && !$result['CommonPrefixes']) { - return $this->triggerError("File or directory not found: {$path}", $flags); - } - // This is a directory prefix - return $this->formatUrlStat($path); - } - } catch (\Exception $e) { - return $this->triggerError($e->getMessage(), $flags); - } - } - - /** - * Support for mkdir(). - * - * @param string $path Directory which should be created. - * @param int $mode Permissions. 700-range permissions map to ACL_PUBLIC. 600-range permissions map to - * ACL_AUTH_READ. All other permissions map to ACL_PRIVATE. Expects octal form. - * @param int $options A bitwise mask of values, such as STREAM_MKDIR_RECURSIVE. - * - * @return bool - * @link http://www.php.net/manual/en/streamwrapper.mkdir.php - */ - public function mkdir($path, $mode, $options) - { - $params = $this->getParams($path); - if (!$params['Bucket']) { - return false; - } - - if (!isset($params['ACL'])) { - $params['ACL'] = $this->determineAcl($mode); - } - - return !isset($params['Key']) || $params['Key'] === '/' - ? $this->createBucket($path, $params) - : $this->createPseudoDirectory($path, $params); - } - - /** - * Remove a bucket from Amazon S3 - * - * @param string $path the directory path - * - * @return bool true if directory was successfully removed - * @link http://www.php.net/manual/en/streamwrapper.rmdir.php - */ - public function rmdir($path) - { - $params = $this->getParams($path); - if (!$params['Bucket']) { - return $this->triggerError('You cannot delete s3://. Please specify a bucket.'); - } - - try { - - if (!$params['Key']) { - static::$client->deleteBucket(array('Bucket' => $params['Bucket'])); - $this->clearStatInfo($path); - return true; - } - - // Use a key that adds a trailing slash if needed. - $prefix = rtrim($params['Key'], '/') . '/'; - - $result = static::$client->listObjects(array( - 'Bucket' => $params['Bucket'], - 'Prefix' => $prefix, - 'MaxKeys' => 1 - )); - - // Check if the bucket contains keys other than the placeholder - if ($result['Contents']) { - foreach ($result['Contents'] as $key) { - if ($key['Key'] == $prefix) { - continue; - } - return $this->triggerError('Psuedo folder is not empty'); - } - return $this->unlink(rtrim($path, '/') . '/'); - } - - return $result['CommonPrefixes'] - ? $this->triggerError('Pseudo folder contains nested folders') - : true; - - } catch (\Exception $e) { - return $this->triggerError($e->getMessage()); - } - } - - /** - * Support for opendir(). - * - * The opendir() method of the Amazon S3 stream wrapper supports a stream - * context option of "listFilter". listFilter must be a callable that - * accepts an associative array of object data and returns true if the - * object should be yielded when iterating the keys in a bucket. - * - * @param string $path The path to the directory (e.g. "s3://dir[</prefix>]") - * @param string $options Whether or not to enforce safe_mode (0x04). Unused. - * - * @return bool true on success - * @see http://www.php.net/manual/en/function.opendir.php - */ - public function dir_opendir($path, $options) - { - // Reset the cache - $this->clearStatInfo(); - $params = $this->getParams($path); - $delimiter = $this->getOption('delimiter'); - $filterFn = $this->getOption('listFilter'); - - if ($delimiter === null) { - $delimiter = '/'; - } - - if ($params['Key']) { - $params['Key'] = rtrim($params['Key'], $delimiter) . $delimiter; - } - - $this->openedBucket = $params['Bucket']; - $this->openedBucketPrefix = $params['Key']; - $operationParams = array('Bucket' => $params['Bucket'], 'Prefix' => $params['Key']); - - if ($delimiter) { - $operationParams['Delimiter'] = $delimiter; - } - - $objectIterator = static::$client->getIterator('ListObjects', $operationParams, array( - 'return_prefixes' => true, - 'sort_results' => true - )); - - // Filter our "/" keys added by the console as directories, and ensure - // that if a filter function is provided that it passes the filter. - $this->objectIterator = new FilterIterator( - $objectIterator, - function ($key) use ($filterFn) { - // Each yielded results can contain a "Key" or "Prefix" - return (!$filterFn || call_user_func($filterFn, $key)) && - (!isset($key['Key']) || substr($key['Key'], -1, 1) !== '/'); - } - ); - - $this->objectIterator->next(); - - return true; - } - - /** - * Close the directory listing handles - * - * @return bool true on success - */ - public function dir_closedir() - { - $this->objectIterator = null; - - return true; - } - - /** - * This method is called in response to rewinddir() - * - * @return boolean true on success - */ - public function dir_rewinddir() - { - $this->clearStatInfo(); - $this->objectIterator->rewind(); - - return true; - } - - /** - * This method is called in response to readdir() - * - * @return string Should return a string representing the next filename, or false if there is no next file. - * - * @link http://www.php.net/manual/en/function.readdir.php - */ - public function dir_readdir() - { - // Skip empty result keys - if (!$this->objectIterator->valid()) { - return false; - } - - $current = $this->objectIterator->current(); - if (isset($current['Prefix'])) { - // Include "directories". Be sure to strip a trailing "/" - // on prefixes. - $prefix = rtrim($current['Prefix'], '/'); - $result = str_replace($this->openedBucketPrefix, '', $prefix); - $key = "s3://{$this->openedBucket}/{$prefix}"; - $stat = $this->formatUrlStat($prefix); - } else { - // Remove the prefix from the result to emulate other - // stream wrappers. - $result = str_replace($this->openedBucketPrefix, '', $current['Key']); - $key = "s3://{$this->openedBucket}/{$current['Key']}"; - $stat = $this->formatUrlStat($current); - } - - // Cache the object data for quick url_stat lookups used with - // RecursiveDirectoryIterator. - static::$nextStat = array($key => $stat); - $this->objectIterator->next(); - - return $result; - } - - /** - * Called in response to rename() to rename a file or directory. Currently only supports renaming objects. - * - * @param string $path_from the path to the file to rename - * @param string $path_to the new path to the file - * - * @return bool true if file was successfully renamed - * @link http://www.php.net/manual/en/function.rename.php - */ - public function rename($path_from, $path_to) - { - $partsFrom = $this->getParams($path_from); - $partsTo = $this->getParams($path_to); - $this->clearStatInfo($path_from); - $this->clearStatInfo($path_to); - - if (!$partsFrom['Key'] || !$partsTo['Key']) { - return $this->triggerError('The Amazon S3 stream wrapper only supports copying objects'); - } - - try { - // Copy the object and allow overriding default parameters if desired, but by default copy metadata - static::$client->copyObject($this->getOptions() + array( - 'Bucket' => $partsTo['Bucket'], - 'Key' => $partsTo['Key'], - 'CopySource' => '/' . $partsFrom['Bucket'] . '/' . rawurlencode($partsFrom['Key']), - 'MetadataDirective' => 'COPY' - )); - // Delete the original object - static::$client->deleteObject(array( - 'Bucket' => $partsFrom['Bucket'], - 'Key' => $partsFrom['Key'] - ) + $this->getOptions()); - } catch (\Exception $e) { - return $this->triggerError($e->getMessage()); - } - - return true; - } - - /** - * Cast the stream to return the underlying file resource - * - * @param int $cast_as STREAM_CAST_FOR_SELECT or STREAM_CAST_AS_STREAM - * - * @return resource - */ - public function stream_cast($cast_as) - { - return $this->body->getStream(); - } - - /** - * Get the stream context options available to the current stream - * - * @return array - */ - protected function getOptions() - { - $context = $this->context ?: stream_context_get_default(); - $options = stream_context_get_options($context); - - return isset($options['s3']) ? $options['s3'] : array(); - } - - /** - * Get a specific stream context option - * - * @param string $name Name of the option to retrieve - * - * @return mixed|null - */ - protected function getOption($name) - { - $options = $this->getOptions(); - - return isset($options[$name]) ? $options[$name] : null; - } - - /** - * Get the bucket and key from the passed path (e.g. s3://bucket/key) - * - * @param string $path Path passed to the stream wrapper - * - * @return array Hash of 'Bucket', 'Key', and custom params - */ - protected function getParams($path) - { - $parts = explode('/', substr($path, 5), 2); - - $params = $this->getOptions(); - unset($params['seekable']); - - return array( - 'Bucket' => $parts[0], - 'Key' => isset($parts[1]) ? $parts[1] : null - ) + $params; - } - - /** - * Serialize and sign a command, returning a request object - * - * @param CommandInterface $command Command to sign - * - * @return RequestInterface - */ - protected function getSignedRequest($command) - { - $request = $command->prepare(); - $request->dispatch('request.before_send', array('request' => $request)); - - return $request; - } - - /** - * Initialize the stream wrapper for a read only stream - * - * @param array $params Operation parameters - * @param array $errors Any encountered errors to append to - * - * @return bool - */ - protected function openReadStream(array $params, array &$errors) - { - // Create the command and serialize the request - $request = $this->getSignedRequest(static::$client->getCommand('GetObject', $params)); - // Create a stream that uses the EntityBody object - $factory = $this->getOption('stream_factory') ?: new PhpStreamRequestFactory(); - $this->body = $factory->fromRequest($request, array(), array('stream_class' => 'Guzzle\Http\EntityBody')); - - // Wrap the body in a caching entity body if seeking is allowed - if ($this->getOption('seekable')) { - $this->body = new CachingEntityBody($this->body); - } - - return true; - } - - /** - * Initialize the stream wrapper for a write only stream - * - * @param array $params Operation parameters - * @param array $errors Any encountered errors to append to - * - * @return bool - */ - protected function openWriteStream(array $params, array &$errors) - { - $this->body = new EntityBody(fopen('php://temp', 'r+')); - } - - /** - * Initialize the stream wrapper for an append stream - * - * @param array $params Operation parameters - * @param array $errors Any encountered errors to append to - * - * @return bool - */ - protected function openAppendStream(array $params, array &$errors) - { - try { - // Get the body of the object - $this->body = static::$client->getObject($params)->get('Body'); - $this->body->seek(0, SEEK_END); - } catch (S3Exception $e) { - // The object does not exist, so use a simple write stream - $this->openWriteStream($params, $errors); - } - - return true; - } - - /** - * Trigger one or more errors - * - * @param string|array $errors Errors to trigger - * @param mixed $flags If set to STREAM_URL_STAT_QUIET, then no error or exception occurs - * - * @return bool Returns false - * @throws RuntimeException if throw_errors is true - */ - protected function triggerError($errors, $flags = null) - { - if ($flags & STREAM_URL_STAT_QUIET) { - // This is triggered with things like file_exists() - - if ($flags & STREAM_URL_STAT_LINK) { - // This is triggered for things like is_link() - return $this->formatUrlStat(false); - } - return false; - } - - // This is triggered when doing things like lstat() or stat() - trigger_error(implode("\n", (array) $errors), E_USER_WARNING); - - return false; - } - - /** - * Prepare a url_stat result array - * - * @param string|array $result Data to add - * - * @return array Returns the modified url_stat result - */ - protected function formatUrlStat($result = null) - { - static $statTemplate = array( - 0 => 0, 'dev' => 0, - 1 => 0, 'ino' => 0, - 2 => 0, 'mode' => 0, - 3 => 0, 'nlink' => 0, - 4 => 0, 'uid' => 0, - 5 => 0, 'gid' => 0, - 6 => -1, 'rdev' => -1, - 7 => 0, 'size' => 0, - 8 => 0, 'atime' => 0, - 9 => 0, 'mtime' => 0, - 10 => 0, 'ctime' => 0, - 11 => -1, 'blksize' => -1, - 12 => -1, 'blocks' => -1, - ); - - $stat = $statTemplate; - $type = gettype($result); - - // Determine what type of data is being cached - if ($type == 'NULL' || $type == 'string') { - // Directory with 0777 access - see "man 2 stat". - $stat['mode'] = $stat[2] = 0040777; - } elseif ($type == 'array' && isset($result['LastModified'])) { - // ListObjects or HeadObject result - $stat['mtime'] = $stat[9] = $stat['ctime'] = $stat[10] = strtotime($result['LastModified']); - $stat['size'] = $stat[7] = (isset($result['ContentLength']) ? $result['ContentLength'] : $result['Size']); - // Regular file with 0777 access - see "man 2 stat". - $stat['mode'] = $stat[2] = 0100777; - } - - return $stat; - } - - /** - * Clear the next stat result from the cache - * - * @param string $path If a path is specific, clearstatcache() will be called - */ - protected function clearStatInfo($path = null) - { - static::$nextStat = array(); - if ($path) { - clearstatcache(true, $path); - } - } - - /** - * Creates a bucket for the given parameters. - * - * @param string $path Stream wrapper path - * @param array $params A result of StreamWrapper::getParams() - * - * @return bool Returns true on success or false on failure - */ - private function createBucket($path, array $params) - { - if (static::$client->doesBucketExist($params['Bucket'])) { - return $this->triggerError("Directory already exists: {$path}"); - } - - try { - static::$client->createBucket($params); - $this->clearStatInfo($path); - return true; - } catch (\Exception $e) { - return $this->triggerError($e->getMessage()); - } - } - - /** - * Creates a pseudo-folder by creating an empty "/" suffixed key - * - * @param string $path Stream wrapper path - * @param array $params A result of StreamWrapper::getParams() - * - * @return bool - */ - private function createPseudoDirectory($path, array $params) - { - // Ensure the path ends in "/" and the body is empty. - $params['Key'] = rtrim($params['Key'], '/') . '/'; - $params['Body'] = ''; - - // Fail if this pseudo directory key already exists - if (static::$client->doesObjectExist($params['Bucket'], $params['Key'])) { - return $this->triggerError("Directory already exists: {$path}"); - } - - try { - static::$client->putObject($params); - $this->clearStatInfo($path); - return true; - } catch (\Exception $e) { - return $this->triggerError($e->getMessage()); - } - } - - /** - * Determine the most appropriate ACL based on a file mode. - * - * @param int $mode File mode - * - * @return string - */ - private function determineAcl($mode) - { - $mode = decoct($mode); - - if ($mode >= 700 && $mode <= 799) { - return 'public-read'; - } - - if ($mode >= 600 && $mode <= 699) { - return 'authenticated-read'; - } - - return 'private'; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/AbstractSync.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/AbstractSync.php deleted file mode 100644 index ac5bbbe6c55..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/AbstractSync.php +++ /dev/null @@ -1,127 +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\Sync; - -use Aws\S3\S3Client; -use Guzzle\Common\AbstractHasDispatcher; -use Guzzle\Common\Collection; -use Guzzle\Iterator\ChunkedIterator; -use Guzzle\Service\Command\CommandInterface; - -abstract class AbstractSync extends AbstractHasDispatcher -{ - const BEFORE_TRANSFER = 's3.sync.before_transfer'; - const AFTER_TRANSFER = 's3.sync.after_transfer'; - - /** @var Collection */ - protected $options; - - /** - * @param array $options Associative array of options: - * - client: (S3Client) used to transfer requests - * - bucket: (string) Amazon S3 bucket - * - iterator: (\Iterator) Iterator that yields SplFileInfo objects to transfer - * - source_converter: (FilenameConverterInterface) Converter used to convert filenames - * - *: Any other options required by subclasses - */ - public function __construct(array $options) - { - $this->options = Collection::fromConfig( - $options, - array('concurrency' => 10), - array('client', 'bucket', 'iterator', 'source_converter') - ); - $this->init(); - } - - public static function getAllEvents() - { - return array(self::BEFORE_TRANSFER, self::AFTER_TRANSFER); - } - - /** - * Begin transferring files - */ - public function transfer() - { - // Pull out chunks of uploads to upload in parallel - $iterator = new ChunkedIterator($this->options['iterator'], $this->options['concurrency']); - foreach ($iterator as $files) { - $this->transferFiles($files); - } - } - - /** - * Create a command or special transfer action for the - * - * @param \SplFileInfo $file File used to build the transfer - * - * @return CommandInterface|callable - */ - abstract protected function createTransferAction(\SplFileInfo $file); - - /** - * Hook to initialize subclasses - * @codeCoverageIgnore - */ - protected function init() {} - - /** - * Process and transfer a group of files - * - * @param array $files Files to transfer - */ - protected function transferFiles(array $files) - { - // Create the base event data object - $event = array('sync' => $this, 'client' => $this->options['client']); - - $commands = array(); - foreach ($files as $file) { - if ($action = $this->createTransferAction($file)) { - $event = array('command' => $action, 'file' => $file) + $event; - $this->dispatch(self::BEFORE_TRANSFER, $event); - if ($action instanceof CommandInterface) { - $commands[] = $action; - } elseif (is_callable($action)) { - $action(); - $this->dispatch(self::AFTER_TRANSFER, $event); - } - } - } - - $this->transferCommands($commands); - } - - /** - * Transfer an array of commands in parallel - * - * @param array $commands Commands to transfer - */ - protected function transferCommands(array $commands) - { - if ($commands) { - $this->options['client']->execute($commands); - // Notify listeners that each command finished - $event = array('sync' => $this, 'client' => $this->options['client']); - foreach ($commands as $command) { - $event['command'] = $command; - $this->dispatch(self::AFTER_TRANSFER, $event); - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/AbstractSyncBuilder.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/AbstractSyncBuilder.php deleted file mode 100644 index df69f4a8519..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/AbstractSyncBuilder.php +++ /dev/null @@ -1,435 +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\Sync; - -use Aws\Common\Exception\RuntimeException; -use Aws\Common\Exception\UnexpectedValueException; -use Aws\Common\Model\MultipartUpload\TransferInterface; -use Aws\S3\S3Client; -use Aws\S3\Iterator\OpendirIterator; -use Guzzle\Common\Event; -use Guzzle\Common\HasDispatcherInterface; -use Guzzle\Iterator\FilterIterator; -use Guzzle\Service\Command\CommandInterface; - -abstract class AbstractSyncBuilder -{ - /** @var \Iterator Iterator that returns SplFileInfo objects to upload */ - protected $sourceIterator; - - /** @var S3Client Amazon S3 client used to send requests */ - protected $client; - - /** @var string Bucket used with the transfer */ - protected $bucket; - - /** @var int Number of files that can be transferred concurrently */ - protected $concurrency = 10; - - /** @var array Custom parameters to add to each operation sent while transferring */ - protected $params = array(); - - /** @var FilenameConverterInterface */ - protected $sourceConverter; - - /** @var FilenameConverterInterface */ - protected $targetConverter; - - /** @var string Prefix at prepend to each Amazon S3 object key */ - protected $keyPrefix = ''; - - /** @var string Directory separator for Amazon S3 keys */ - protected $delimiter = '/'; - - /** @var string Base directory to remove from each file path before converting to an object name or file name */ - protected $baseDir; - - /** @var bool Whether or not to only transfer modified or new files */ - protected $forcing = false; - - /** @var bool Whether or not debug output is enable */ - protected $debug; - - /** - * @return static - */ - public static function getInstance() - { - return new static(); - } - - /** - * Set the bucket to use with the sync - * - * @param string $bucket Amazon S3 bucket name - * - * @return $this - */ - public function setBucket($bucket) - { - $this->bucket = $bucket; - - return $this; - } - - /** - * Set the Amazon S3 client object that will send requests - * - * @param S3Client $client Amazon S3 client - * - * @return $this - */ - public function setClient(S3Client $client) - { - $this->client = $client; - - return $this; - } - - /** - * Set a custom iterator that returns \SplFileInfo objects for the source data - * - * @param \Iterator $iterator - * - * @return $this - */ - public function setSourceIterator(\Iterator $iterator) - { - $this->sourceIterator = $iterator; - - return $this; - } - - /** - * Set a custom object key provider instead of building one internally - * - * @param FileNameConverterInterface $converter Filename to object key provider - * - * @return $this - */ - public function setSourceFilenameConverter(FilenameConverterInterface $converter) - { - $this->sourceConverter = $converter; - - return $this; - } - - /** - * Set a custom object key provider instead of building one internally - * - * @param FileNameConverterInterface $converter Filename to object key provider - * - * @return $this - */ - public function setTargetFilenameConverter(FilenameConverterInterface $converter) - { - $this->targetConverter = $converter; - - return $this; - } - - /** - * Set the base directory of the files being transferred. The base directory is removed from each file path before - * converting the file path to an object key or vice versa. - * - * @param string $baseDir Base directory, which will be deleted from each uploaded object key - * - * @return $this - */ - public function setBaseDir($baseDir) - { - $this->baseDir = $baseDir; - - return $this; - } - - /** - * Specify a prefix to prepend to each Amazon S3 object key or the prefix where object are stored in a bucket - * - * Can be used to upload files to a pseudo sub-folder key or only download files from a pseudo sub-folder - * - * @param string $keyPrefix Prefix for each uploaded key - * - * @return $this - */ - public function setKeyPrefix($keyPrefix) - { - // Removing leading slash - $this->keyPrefix = ltrim($keyPrefix, '/'); - - return $this; - } - - /** - * Specify the delimiter used for the targeted filesystem (default delimiter is "/") - * - * @param string $delimiter Delimiter to use to separate paths - * - * @return $this - */ - public function setDelimiter($delimiter) - { - $this->delimiter = $delimiter; - - return $this; - } - - /** - * Specify an array of operation parameters to apply to each operation executed by the sync object - * - * @param array $params Associative array of PutObject (upload) GetObject (download) parameters - * - * @return $this - */ - public function setOperationParams(array $params) - { - $this->params = $params; - - return $this; - } - - /** - * Set the number of files that can be transferred concurrently - * - * @param int $concurrency Number of concurrent transfers - * - * @return $this - */ - public function setConcurrency($concurrency) - { - $this->concurrency = $concurrency; - - return $this; - } - - /** - * Set to true to force transfers even if a file already exists and has not changed - * - * @param bool $force Set to true to force transfers without checking if it has changed - * - * @return $this - */ - public function force($force = false) - { - $this->forcing = (bool) $force; - - return $this; - } - - /** - * Enable debug mode - * - * @param bool|resource $enabledOrResource Set to true or false to enable or disable debug output. Pass an opened - * fopen resource to write to instead of writing to standard out. - * @return $this - */ - public function enableDebugOutput($enabledOrResource = true) - { - $this->debug = $enabledOrResource; - - return $this; - } - - /** - * Add a filename filter that uses a regular expression to filter out files that you do not wish to transfer. - * - * @param string $search Regular expression search (in preg_match format). Any filename that matches this regex - * will not be transferred. - * @return $this - */ - public function addRegexFilter($search) - { - $this->assertFileIteratorSet(); - $this->sourceIterator = new FilterIterator($this->sourceIterator, function ($i) use ($search) { - return !preg_match($search, (string) $i); - }); - $this->sourceIterator->rewind(); - - return $this; - } - - /** - * Builds a UploadSync or DownloadSync object - * - * @return AbstractSync - */ - public function build() - { - $this->validateRequirements(); - $this->sourceConverter = $this->sourceConverter ?: $this->getDefaultSourceConverter(); - $this->targetConverter = $this->targetConverter ?: $this->getDefaultTargetConverter(); - - // Only wrap the source iterator in a changed files iterator if we are not forcing the transfers - if (!$this->forcing) { - $this->sourceIterator->rewind(); - $this->sourceIterator = new ChangedFilesIterator( - new \NoRewindIterator($this->sourceIterator), - $this->getTargetIterator(), - $this->sourceConverter, - $this->targetConverter - ); - $this->sourceIterator->rewind(); - } - - $sync = $this->specificBuild(); - - if ($this->params) { - $this->addCustomParamListener($sync); - } - - if ($this->debug) { - $this->addDebugListener($sync, is_bool($this->debug) ? STDOUT : $this->debug); - } - - return $sync; - } - - /** - * Hook to implement in subclasses - * - * @return AbstractSync - */ - abstract protected function specificBuild(); - - /** - * @return \Iterator - */ - abstract protected function getTargetIterator(); - - /** - * @return FilenameConverterInterface - */ - abstract protected function getDefaultSourceConverter(); - - /** - * @return FilenameConverterInterface - */ - abstract protected function getDefaultTargetConverter(); - - /** - * Add a listener to the sync object to output debug information while transferring - * - * @param AbstractSync $sync Sync object to listen to - * @param resource $resource Where to write debug messages - */ - abstract protected function addDebugListener(AbstractSync $sync, $resource); - - /** - * Validate that the builder has the minimal requirements - * - * @throws RuntimeException if the builder is not configured completely - */ - protected function validateRequirements() - { - if (!$this->client) { - throw new RuntimeException('No client was provided'); - } - if (!$this->bucket) { - throw new RuntimeException('No bucket was provided'); - } - $this->assertFileIteratorSet(); - } - - /** - * Ensure that the base file iterator has been provided - * - * @throws RuntimeException - */ - protected function assertFileIteratorSet() - { - // Interesting... Need to use isset because: Object of class GlobIterator could not be converted to boolean - if (!isset($this->sourceIterator)) { - throw new RuntimeException('A source file iterator must be specified'); - } - } - - /** - * Wraps a generated iterator in a filter iterator that removes directories - * - * @param \Iterator $iterator Iterator to wrap - * - * @return \Iterator - * @throws UnexpectedValueException - */ - protected function filterIterator(\Iterator $iterator) - { - $f = new FilterIterator($iterator, function ($i) { - if (!$i instanceof \SplFileInfo) { - throw new UnexpectedValueException('All iterators for UploadSync must return SplFileInfo objects'); - } - return $i->isFile(); - }); - - $f->rewind(); - - return $f; - } - - /** - * Add the custom param listener to a transfer object - * - * @param HasDispatcherInterface $sync - */ - protected function addCustomParamListener(HasDispatcherInterface $sync) - { - $params = $this->params; - $sync->getEventDispatcher()->addListener( - UploadSync::BEFORE_TRANSFER, - function (Event $e) use ($params) { - if ($e['command'] instanceof CommandInterface) { - $e['command']->overwriteWith($params); - } - } - ); - } - - /** - * Create an Amazon S3 file iterator based on the given builder settings - * - * @return OpendirIterator - */ - protected function createS3Iterator() - { - // Ensure that the stream wrapper is registered - $this->client->registerStreamWrapper(); - - // Calculate the opendir() bucket and optional key prefix location - $dir = "s3://{$this->bucket}"; - if ($this->keyPrefix) { - $dir .= '/' . ltrim($this->keyPrefix, '/ '); - } - - // Use opendir so that we can pass stream context to the iterator - $dh = opendir($dir, stream_context_create(array( - 's3' => array( - 'delimiter' => '', - 'listFilter' => function ($obj) { - // Ensure that we do not try to download a glacier object. - return !isset($obj['StorageClass']) || - $obj['StorageClass'] != 'GLACIER'; - } - ) - ))); - - // Add the trailing slash for the OpendirIterator concatenation - if (!$this->keyPrefix) { - $dir .= '/'; - } - - return $this->filterIterator(new \NoRewindIterator(new OpendirIterator($dh, $dir))); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/ChangedFilesIterator.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/ChangedFilesIterator.php deleted file mode 100644 index a39edceb619..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/ChangedFilesIterator.php +++ /dev/null @@ -1,125 +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\Sync; - -/** - * Iterator used to filter an internal iterator to only yield files that do not exist in the target iterator or files - * that have changed - */ -class ChangedFilesIterator extends \FilterIterator -{ - /** @var \Iterator */ - protected $sourceIterator; - - /** @var \Iterator */ - protected $targetIterator; - - /** @var FilenameConverterInterface */ - protected $sourceConverter; - - /** @var FilenameConverterInterface */ - protected $targetConverter; - - /** @var array Previously loaded data */ - protected $cache = array(); - - /** - * @param \Iterator $sourceIterator Iterator to wrap and filter - * @param \Iterator $targetIterator Iterator used to compare against the source iterator - * @param FilenameConverterInterface $sourceConverter Key converter to convert source to target keys - * @param FilenameConverterInterface $targetConverter Key converter to convert target to source keys - */ - public function __construct( - \Iterator $sourceIterator, - \Iterator $targetIterator, - FilenameConverterInterface $sourceConverter, - FilenameConverterInterface $targetConverter - ) { - $this->targetIterator = $targetIterator; - $this->sourceConverter = $sourceConverter; - $this->targetConverter = $targetConverter; - parent::__construct($sourceIterator); - } - - public function accept() - { - $current = $this->current(); - $key = $this->sourceConverter->convert($this->normalize($current)); - if (!($data = $this->getTargetData($key))) { - return true; - } - - // Ensure the Content-Length matches and it hasn't been modified since the mtime - return $current->getSize() != $data[0] || $current->getMTime() > $data[1]; - } - - /** - * Returns an array of the files from the target iterator that were not found in the source iterator - * - * @return array - */ - public function getUnmatched() - { - return array_keys($this->cache); - } - - /** - * Get key information from the target iterator for a particular filename - * - * @param string $key Target iterator filename - * - * @return array|bool Returns an array of data, or false if the key is not in the iterator - */ - protected function getTargetData($key) - { - $key = $this->cleanKey($key); - - if (isset($this->cache[$key])) { - $result = $this->cache[$key]; - unset($this->cache[$key]); - return $result; - } - - $it = $this->targetIterator; - - while ($it->valid()) { - $value = $it->current(); - $data = array($value->getSize(), $value->getMTime()); - $filename = $this->targetConverter->convert($this->normalize($value)); - $filename = $this->cleanKey($filename); - - if ($filename == $key) { - return $data; - } - - $this->cache[$filename] = $data; - $it->next(); - } - - return false; - } - - private function normalize($current) - { - return $current->getRealPath() ?: (string) $current; - } - - private function cleanKey($key) - { - return ltrim($key, '/'); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/DownloadSync.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/DownloadSync.php deleted file mode 100644 index 560ccdfe937..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/DownloadSync.php +++ /dev/null @@ -1,95 +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\Sync; - -use Aws\Common\Exception\RuntimeException; -use Aws\S3\ResumableDownload; - -/** - * Downloads and Amazon S3 bucket to a local directory - */ -class DownloadSync extends AbstractSync -{ - protected function createTransferAction(\SplFileInfo $file) - { - $sourceFilename = $file->getPathname(); - list($bucket, $key) = explode('/', substr($sourceFilename, 5), 2); - $filename = $this->options['source_converter']->convert($sourceFilename); - $this->createDirectory($filename); - - // Some S3 buckets contains nested files under the same name as a directory - if (is_dir($filename)) { - return false; - } - - // Allow a previously interrupted download to resume - if (file_exists($filename) && $this->options['resumable']) { - return new ResumableDownload($this->options['client'], $bucket, $key, $filename); - } - - return $this->options['client']->getCommand('GetObject', array( - 'Bucket' => $bucket, - 'Key' => $key, - 'SaveAs' => $filename - )); - } - - /** - * @codeCoverageIgnore - */ - protected function createDirectory($filename) - { - $directory = dirname($filename); - // Some S3 clients create empty files to denote directories. Remove these so that we can create the directory. - if (is_file($directory) && filesize($directory) == 0) { - unlink($directory); - } - // Create the directory if it does not exist - if (!is_dir($directory) && !mkdir($directory, 0777, true)) { - $errors = error_get_last(); - throw new RuntimeException('Could not create directory: ' . $directory . ' - ' . $errors['message']); - } - } - - protected function filterCommands(array $commands) - { - // Build a list of all of the directories in each command so that we don't attempt to create an empty dir in - // the same parallel transfer as attempting to create a file in that dir - $dirs = array(); - foreach ($commands as $command) { - $parts = array_values(array_filter(explode('/', $command['SaveAs']))); - for ($i = 0, $total = count($parts); $i < $total; $i++) { - $dir = ''; - for ($j = 0; $j < $i; $j++) { - $dir .= '/' . $parts[$j]; - } - if ($dir && !in_array($dir, $dirs)) { - $dirs[] = $dir; - } - } - } - - return array_filter($commands, function ($command) use ($dirs) { - return !in_array($command['SaveAs'], $dirs); - }); - } - - protected function transferCommands(array $commands) - { - parent::transferCommands($this->filterCommands($commands)); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/DownloadSyncBuilder.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/DownloadSyncBuilder.php deleted file mode 100644 index d9cd044449a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/DownloadSyncBuilder.php +++ /dev/null @@ -1,129 +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\Sync; - -use Aws\Common\Exception\RuntimeException; -use Aws\S3\ResumableDownload; -use Guzzle\Common\Event; -use Guzzle\Http\EntityBodyInterface; -use Guzzle\Service\Command\CommandInterface; - -class DownloadSyncBuilder extends AbstractSyncBuilder -{ - /** @var bool */ - protected $resumable = false; - - /** @var string */ - protected $directory; - - /** @var int Number of files that can be transferred concurrently */ - protected $concurrency = 5; - - /** - * Set the directory where the objects from be downloaded to - * - * @param string $directory Directory - * - * @return $this - */ - public function setDirectory($directory) - { - $this->directory = $directory; - - return $this; - } - - /** - * Call this function to allow partial downloads to be resumed if the download was previously interrupted - * - * @return self - */ - public function allowResumableDownloads() - { - $this->resumable = true; - - return $this; - } - - protected function specificBuild() - { - $sync = new DownloadSync(array( - 'client' => $this->client, - 'bucket' => $this->bucket, - 'iterator' => $this->sourceIterator, - 'source_converter' => $this->sourceConverter, - 'target_converter' => $this->targetConverter, - 'concurrency' => $this->concurrency, - 'resumable' => $this->resumable, - 'directory' => $this->directory - )); - - return $sync; - } - - protected function getTargetIterator() - { - if (!$this->directory) { - throw new RuntimeException('A directory is required'); - } - - if (!is_dir($this->directory) && !mkdir($this->directory, 0777, true)) { - // @codeCoverageIgnoreStart - throw new RuntimeException('Unable to create root download directory: ' . $this->directory); - // @codeCoverageIgnoreEnd - } - - return $this->filterIterator( - new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->directory)) - ); - } - - protected function getDefaultSourceConverter() - { - return new KeyConverter( - "s3://{$this->bucket}/{$this->baseDir}", - $this->directory . DIRECTORY_SEPARATOR, $this->delimiter - ); - } - - protected function getDefaultTargetConverter() - { - return new KeyConverter("s3://{$this->bucket}/{$this->baseDir}", '', $this->delimiter); - } - - protected function assertFileIteratorSet() - { - $this->sourceIterator = $this->sourceIterator ?: $this->createS3Iterator(); - } - - protected function addDebugListener(AbstractSync $sync, $resource) - { - $sync->getEventDispatcher()->addListener(UploadSync::BEFORE_TRANSFER, function (Event $e) use ($resource) { - if ($e['command'] instanceof CommandInterface) { - $from = $e['command']['Bucket'] . '/' . $e['command']['Key']; - $to = $e['command']['SaveAs'] instanceof EntityBodyInterface - ? $e['command']['SaveAs']->getUri() - : $e['command']['SaveAs']; - fwrite($resource, "Downloading {$from} -> {$to}\n"); - } elseif ($e['command'] instanceof ResumableDownload) { - $from = $e['command']->getBucket() . '/' . $e['command']->getKey(); - $to = $e['command']->getFilename(); - fwrite($resource, "Resuming {$from} -> {$to}\n"); - } - }); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/FilenameConverterInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/FilenameConverterInterface.php deleted file mode 100644 index ded2cfb465a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/FilenameConverterInterface.php +++ /dev/null @@ -1,32 +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\Sync; - -/** - * Converts filenames from one system to another (e.g. local to Amazon S3) - */ -interface FilenameConverterInterface -{ - /** - * Convert a filename - * - * @param string $filename Name of the file to convert - * - * @return string - */ - public function convert($filename); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/KeyConverter.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/KeyConverter.php deleted file mode 100644 index 7cfee06d2da..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/KeyConverter.php +++ /dev/null @@ -1,67 +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\Sync; - -/** - * Converts filenames from one system to another - */ -class KeyConverter implements FilenameConverterInterface -{ - /** @var string Directory separator for Amazon S3 keys */ - protected $delimiter; - - /** @var string Prefix to prepend to each Amazon S3 object key */ - protected $prefix; - - /** @var string Base directory to remove from each file path before converting to an object key */ - protected $baseDir; - - /** - * @param string $baseDir Base directory to remove from each converted name - * @param string $prefix Amazon S3 prefix - * @param string $delimiter Directory separator used with generated names - */ - public function __construct($baseDir = '', $prefix = '', $delimiter = '/') - { - $this->baseDir = (string) $baseDir; - $this->prefix = $prefix; - $this->delimiter = $delimiter; - } - - public function convert($filename) - { - $key = $filename; - - // Remove base directory from the key (only the first occurrence) - if ($this->baseDir && (false !== $pos = strpos($filename, $this->baseDir))) { - $key = substr_replace($key, '', $pos, strlen($this->baseDir)); - } - - // Replace Windows directory separators to become Unix style, and convert that to the custom dir separator - $key = str_replace('/', $this->delimiter, str_replace('\\', '/', $key)); - - // Add the key prefix and remove double slashes that are not in the protocol (e.g. prefixed with ":") - $delim = preg_quote($this->delimiter); - $key = preg_replace( - "#(?<!:){$delim}{$delim}#", - $this->delimiter, - $this->prefix . $key - ); - - return $key; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/UploadSync.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/UploadSync.php deleted file mode 100644 index 31b81e63575..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/UploadSync.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\Sync; - -use Aws\Common\Exception\RuntimeException; -use Aws\S3\Model\MultipartUpload\UploadBuilder; -use Aws\S3\Model\MultipartUpload\AbstractTransfer; -use Guzzle\Http\EntityBody; - -/** - * Uploads a local directory tree to Amazon S3 - */ -class UploadSync extends AbstractSync -{ - const BEFORE_MULTIPART_BUILD = 's3.sync.before_multipart_build'; - - protected function init() - { - if (null == $this->options['multipart_upload_size']) { - $this->options['multipart_upload_size'] = AbstractTransfer::MIN_PART_SIZE; - } - } - - protected function createTransferAction(\SplFileInfo $file) - { - // Open the file for reading - $filename = $file->getRealPath() ?: $file->getPathName(); - - if (!($resource = fopen($filename, 'r'))) { - // @codeCoverageIgnoreStart - throw new RuntimeException('Could not open ' . $file->getPathname() . ' for reading'); - // @codeCoverageIgnoreEnd - } - - $key = $this->options['source_converter']->convert($filename); - $body = EntityBody::factory($resource); - - // Determine how the ACL should be applied - if ($acl = $this->options['acl']) { - $aclType = is_string($this->options['acl']) ? 'ACL' : 'ACP'; - } else { - $acl = 'private'; - $aclType = 'ACL'; - } - - // Use a multi-part upload if the file is larger than the cutoff size and is a regular file - if ($body->getWrapper() == 'plainfile' && $file->getSize() >= $this->options['multipart_upload_size']) { - $builder = UploadBuilder::newInstance() - ->setBucket($this->options['bucket']) - ->setKey($key) - ->setMinPartSize($this->options['multipart_upload_size']) - ->setOption($aclType, $acl) - ->setClient($this->options['client']) - ->setSource($body) - ->setConcurrency($this->options['concurrency']); - - $this->dispatch( - self::BEFORE_MULTIPART_BUILD, - array('builder' => $builder, 'file' => $file) - ); - - return $builder->build(); - } - - return $this->options['client']->getCommand('PutObject', array( - 'Bucket' => $this->options['bucket'], - 'Key' => $key, - 'Body' => $body, - $aclType => $acl - )); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/UploadSyncBuilder.php b/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/UploadSyncBuilder.php deleted file mode 100644 index 20830590692..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Aws/S3/Sync/UploadSyncBuilder.php +++ /dev/null @@ -1,190 +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\Sync; - -use \FilesystemIterator as FI; -use Aws\Common\Model\MultipartUpload\AbstractTransfer; -use Aws\S3\Model\Acp; -use Guzzle\Common\HasDispatcherInterface; -use Guzzle\Common\Event; -use Guzzle\Service\Command\CommandInterface; - -class UploadSyncBuilder extends AbstractSyncBuilder -{ - /** @var string|Acp Access control policy to set on each object */ - protected $acp = 'private'; - - /** @var int */ - protected $multipartUploadSize; - - /** - * Set the path that contains files to recursively upload to Amazon S3 - * - * @param string $path Path that contains files to upload - * - * @return $this - */ - public function uploadFromDirectory($path) - { - $this->baseDir = realpath($path); - $this->sourceIterator = $this->filterIterator(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator( - $path, - FI::SKIP_DOTS | FI::UNIX_PATHS | FI::FOLLOW_SYMLINKS - ))); - - return $this; - } - - /** - * Set a glob expression that will match files to upload to Amazon S3 - * - * @param string $glob Glob expression - * - * @return $this - * @link http://www.php.net/manual/en/function.glob.php - */ - public function uploadFromGlob($glob) - { - $this->sourceIterator = $this->filterIterator( - new \GlobIterator($glob, FI::SKIP_DOTS | FI::UNIX_PATHS | FI::FOLLOW_SYMLINKS) - ); - - return $this; - } - - /** - * Set a canned ACL to apply to each uploaded object - * - * @param string $acl Canned ACL for each upload - * - * @return $this - */ - public function setAcl($acl) - { - $this->acp = $acl; - - return $this; - } - - /** - * Set an Access Control Policy to apply to each uploaded object - * - * @param Acp $acp Access control policy - * - * @return $this - */ - public function setAcp(Acp $acp) - { - $this->acp = $acp; - - return $this; - } - - /** - * Set the multipart upload size threshold. When the size of a file exceeds this value, the file will be uploaded - * using a multipart upload. - * - * @param int $size Size threshold - * - * @return $this - */ - public function setMultipartUploadSize($size) - { - $this->multipartUploadSize = $size; - - return $this; - } - - protected function specificBuild() - { - $sync = new UploadSync(array( - 'client' => $this->client, - 'bucket' => $this->bucket, - 'iterator' => $this->sourceIterator, - 'source_converter' => $this->sourceConverter, - 'target_converter' => $this->targetConverter, - 'concurrency' => $this->concurrency, - 'multipart_upload_size' => $this->multipartUploadSize, - 'acl' => $this->acp - )); - - return $sync; - } - - protected function addCustomParamListener(HasDispatcherInterface $sync) - { - // Handle the special multi-part upload event - parent::addCustomParamListener($sync); - $params = $this->params; - $sync->getEventDispatcher()->addListener( - UploadSync::BEFORE_MULTIPART_BUILD, - function (Event $e) use ($params) { - foreach ($params as $k => $v) { - $e['builder']->setOption($k, $v); - } - } - ); - } - - protected function getTargetIterator() - { - return $this->createS3Iterator(); - } - - protected function getDefaultSourceConverter() - { - return new KeyConverter($this->baseDir, $this->keyPrefix . $this->delimiter, $this->delimiter); - } - - protected function getDefaultTargetConverter() - { - return new KeyConverter('s3://' . $this->bucket . '/', '', DIRECTORY_SEPARATOR); - } - - protected function addDebugListener(AbstractSync $sync, $resource) - { - $sync->getEventDispatcher()->addListener(UploadSync::BEFORE_TRANSFER, function (Event $e) use ($resource) { - - $c = $e['command']; - - if ($c instanceof CommandInterface) { - $uri = $c['Body']->getUri(); - $size = $c['Body']->getSize(); - fwrite($resource, "Uploading {$uri} -> {$c['Key']} ({$size} bytes)\n"); - return; - } - - // Multipart upload - $body = $c->getSource(); - $totalSize = $body->getSize(); - $progress = 0; - fwrite($resource, "Beginning multipart upload: " . $body->getUri() . ' -> '); - fwrite($resource, $c->getState()->getFromId('Key') . " ({$totalSize} bytes)\n"); - - $c->getEventDispatcher()->addListener( - AbstractTransfer::BEFORE_PART_UPLOAD, - function ($e) use (&$progress, $totalSize, $resource) { - $command = $e['command']; - $size = $command['Body']->getContentLength(); - $percentage = number_format(($progress / $totalSize) * 100, 2); - fwrite($resource, "- Part {$command['PartNumber']} ({$size} bytes, {$percentage}%)\n"); - $progress += $size; - } - ); - }); - } -} |