diff options
author | Robin Appelman <robin@icewind.nl> | 2017-04-20 13:47:30 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-09-18 15:16:26 +0200 |
commit | cf1da57c1d38852a21aea701fd9194c0c6226c20 (patch) | |
tree | 695f648c3c32ecdc61b5a3311bb3d556103dde2c /apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch | |
parent | ca5c3f839affb1acefc3b3d4170e13a030da613f (diff) | |
download | nextcloud-server-cf1da57c1d38852a21aea701fd9194c0c6226c20.tar.gz nextcloud-server-cf1da57c1d38852a21aea701fd9194c0c6226c20.zip |
remove non composer aws sdk
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch')
17 files changed, 0 insertions, 997 deletions
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/AbstractBatchDecorator.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/AbstractBatchDecorator.php deleted file mode 100644 index 0625d71c302..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/AbstractBatchDecorator.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -/** - * Abstract decorator used when decorating a BatchInterface - */ -abstract class AbstractBatchDecorator implements BatchInterface -{ - /** @var BatchInterface Decorated batch object */ - protected $decoratedBatch; - - /** - * @param BatchInterface $decoratedBatch BatchInterface that is being decorated - */ - public function __construct(BatchInterface $decoratedBatch) - { - $this->decoratedBatch = $decoratedBatch; - } - - /** - * Allow decorators to implement custom methods - * - * @param string $method Missing method name - * @param array $args Method arguments - * - * @return mixed - * @codeCoverageIgnore - */ - public function __call($method, array $args) - { - return call_user_func_array(array($this->decoratedBatch, $method), $args); - } - - public function add($item) - { - $this->decoratedBatch->add($item); - - return $this; - } - - public function flush() - { - return $this->decoratedBatch->flush(); - } - - public function isEmpty() - { - return $this->decoratedBatch->isEmpty(); - } - - /** - * Trace the decorators associated with the batch - * - * @return array - */ - public function getDecorators() - { - $found = array($this); - if (method_exists($this->decoratedBatch, 'getDecorators')) { - $found = array_merge($found, $this->decoratedBatch->getDecorators()); - } - - return $found; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/Batch.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/Batch.php deleted file mode 100644 index 4d41c54f887..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/Batch.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -use Guzzle\Batch\Exception\BatchTransferException; - -/** - * Default batch implementation used to convert queued items into smaller chunks of batches using a - * {@see BatchDivisorIterface} and transfers each batch using a {@see BatchTransferInterface}. - * - * Any exception encountered during a flush operation will throw a {@see BatchTransferException} object containing the - * batch that failed. After an exception is encountered, you can flush the batch again to attempt to finish transferring - * any previously created batches or queued items. - */ -class Batch implements BatchInterface -{ - /** @var \SplQueue Queue of items in the queue */ - protected $queue; - - /** @var array Divided batches to be transferred */ - protected $dividedBatches; - - /** @var BatchTransferInterface */ - protected $transferStrategy; - - /** @var BatchDivisorInterface */ - protected $divisionStrategy; - - /** - * @param BatchTransferInterface $transferStrategy Strategy used to transfer items - * @param BatchDivisorInterface $divisionStrategy Divisor used to create batches - */ - public function __construct(BatchTransferInterface $transferStrategy, BatchDivisorInterface $divisionStrategy) - { - $this->transferStrategy = $transferStrategy; - $this->divisionStrategy = $divisionStrategy; - $this->queue = new \SplQueue(); - $this->queue->setIteratorMode(\SplQueue::IT_MODE_DELETE); - $this->dividedBatches = array(); - } - - public function add($item) - { - $this->queue->enqueue($item); - - return $this; - } - - public function flush() - { - $this->createBatches(); - - $items = array(); - foreach ($this->dividedBatches as $batchIndex => $dividedBatch) { - while ($dividedBatch->valid()) { - $batch = $dividedBatch->current(); - $dividedBatch->next(); - try { - $this->transferStrategy->transfer($batch); - $items = array_merge($items, $batch); - } catch (\Exception $e) { - throw new BatchTransferException($batch, $items, $e, $this->transferStrategy, $this->divisionStrategy); - } - } - // Keep the divided batch down to a minimum in case of a later exception - unset($this->dividedBatches[$batchIndex]); - } - - return $items; - } - - public function isEmpty() - { - return count($this->queue) == 0 && count($this->dividedBatches) == 0; - } - - /** - * Create batches for any queued items - */ - protected function createBatches() - { - if (count($this->queue)) { - if ($batches = $this->divisionStrategy->createBatches($this->queue)) { - // Convert arrays into iterators - if (is_array($batches)) { - $batches = new \ArrayIterator($batches); - } - $this->dividedBatches[] = $batches; - } - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchBuilder.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchBuilder.php deleted file mode 100644 index ea99b4dd090..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchBuilder.php +++ /dev/null @@ -1,199 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -use Guzzle\Common\Exception\InvalidArgumentException; -use Guzzle\Common\Exception\RuntimeException; - -/** - * Builder used to create custom batch objects - */ -class BatchBuilder -{ - /** @var bool Whether or not the batch should automatically flush*/ - protected $autoFlush = false; - - /** @var bool Whether or not to maintain a batch history */ - protected $history = false; - - /** @var bool Whether or not to buffer exceptions encountered in transfer */ - protected $exceptionBuffering = false; - - /** @var mixed Callable to invoke each time a flush completes */ - protected $afterFlush; - - /** @var BatchTransferInterface Object used to transfer items in the queue */ - protected $transferStrategy; - - /** @var BatchDivisorInterface Object used to divide the queue into batches */ - protected $divisorStrategy; - - /** @var array of Mapped transfer strategies by handle name */ - protected static $mapping = array( - 'request' => 'Guzzle\Batch\BatchRequestTransfer', - 'command' => 'Guzzle\Batch\BatchCommandTransfer' - ); - - /** - * Create a new instance of the BatchBuilder - * - * @return BatchBuilder - */ - public static function factory() - { - return new self(); - } - - /** - * Automatically flush the batch when the size of the queue reaches a certain threshold. Adds {@see FlushingBatch}. - * - * @param $threshold Number of items to allow in the queue before a flush - * - * @return BatchBuilder - */ - public function autoFlushAt($threshold) - { - $this->autoFlush = $threshold; - - return $this; - } - - /** - * Maintain a history of all items that have been transferred using the batch. Adds {@see HistoryBatch}. - * - * @return BatchBuilder - */ - public function keepHistory() - { - $this->history = true; - - return $this; - } - - /** - * Buffer exceptions thrown during transfer so that you can transfer as much as possible, and after a transfer - * completes, inspect each exception that was thrown. Enables the {@see ExceptionBufferingBatch} decorator. - * - * @return BatchBuilder - */ - public function bufferExceptions() - { - $this->exceptionBuffering = true; - - return $this; - } - - /** - * Notify a callable each time a batch flush completes. Enables the {@see NotifyingBatch} decorator. - * - * @param mixed $callable Callable function to notify - * - * @return BatchBuilder - * @throws InvalidArgumentException if the argument is not callable - */ - public function notify($callable) - { - $this->afterFlush = $callable; - - return $this; - } - - /** - * Configures the batch to transfer batches of requests. Associates a {@see \Guzzle\Http\BatchRequestTransfer} - * object as both the transfer and divisor strategy. - * - * @param int $batchSize Batch size for each batch of requests - * - * @return BatchBuilder - */ - public function transferRequests($batchSize = 50) - { - $className = self::$mapping['request']; - $this->transferStrategy = new $className($batchSize); - $this->divisorStrategy = $this->transferStrategy; - - return $this; - } - - /** - * Configures the batch to transfer batches commands. Associates as - * {@see \Guzzle\Service\Command\BatchCommandTransfer} as both the transfer and divisor strategy. - * - * @param int $batchSize Batch size for each batch of commands - * - * @return BatchBuilder - */ - public function transferCommands($batchSize = 50) - { - $className = self::$mapping['command']; - $this->transferStrategy = new $className($batchSize); - $this->divisorStrategy = $this->transferStrategy; - - return $this; - } - - /** - * Specify the strategy used to divide the queue into an array of batches - * - * @param BatchDivisorInterface $divisorStrategy Strategy used to divide a batch queue into batches - * - * @return BatchBuilder - */ - public function createBatchesWith(BatchDivisorInterface $divisorStrategy) - { - $this->divisorStrategy = $divisorStrategy; - - return $this; - } - - /** - * Specify the strategy used to transport the items when flush is called - * - * @param BatchTransferInterface $transferStrategy How items are transferred - * - * @return BatchBuilder - */ - public function transferWith(BatchTransferInterface $transferStrategy) - { - $this->transferStrategy = $transferStrategy; - - return $this; - } - - /** - * Create and return the instantiated batch - * - * @return BatchInterface - * @throws RuntimeException if no transfer strategy has been specified - */ - public function build() - { - if (!$this->transferStrategy) { - throw new RuntimeException('No transfer strategy has been specified'); - } - - if (!$this->divisorStrategy) { - throw new RuntimeException('No divisor strategy has been specified'); - } - - $batch = new Batch($this->transferStrategy, $this->divisorStrategy); - - if ($this->exceptionBuffering) { - $batch = new ExceptionBufferingBatch($batch); - } - - if ($this->afterFlush) { - $batch = new NotifyingBatch($batch, $this->afterFlush); - } - - if ($this->autoFlush) { - $batch = new FlushingBatch($batch, $this->autoFlush); - } - - if ($this->history) { - $batch = new HistoryBatch($batch); - } - - return $batch; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchClosureDivisor.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchClosureDivisor.php deleted file mode 100644 index e0a2d9568c7..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchClosureDivisor.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -use Guzzle\Common\Exception\InvalidArgumentException; - -/** - * Divides batches using a callable - */ -class BatchClosureDivisor implements BatchDivisorInterface -{ - /** @var callable Method used to divide the batches */ - protected $callable; - - /** @var mixed $context Context passed to the callable */ - protected $context; - - /** - * @param callable $callable Method used to divide the batches. The method must accept an \SplQueue and return an - * array of arrays containing the divided items. - * @param mixed $context Optional context to pass to the batch divisor - * - * @throws InvalidArgumentException if the callable is not callable - */ - public function __construct($callable, $context = null) - { - if (!is_callable($callable)) { - throw new InvalidArgumentException('Must pass a callable'); - } - - $this->callable = $callable; - $this->context = $context; - } - - public function createBatches(\SplQueue $queue) - { - return call_user_func($this->callable, $queue, $this->context); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchClosureTransfer.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchClosureTransfer.php deleted file mode 100644 index 9cbf1aba40b..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchClosureTransfer.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -use Guzzle\Common\Exception\InvalidArgumentException; - -/** - * Batch transfer strategy where transfer logic can be defined via a Closure. - * This class is to be used with {@see Guzzle\Batch\BatchInterface} - */ -class BatchClosureTransfer implements BatchTransferInterface -{ - /** @var callable A closure that performs the transfer */ - protected $callable; - - /** @var mixed $context Context passed to the callable */ - protected $context; - - /** - * @param mixed $callable Callable that performs the transfer. This function should accept two arguments: - * (array $batch, mixed $context). - * @param mixed $context Optional context to pass to the batch divisor - * - * @throws InvalidArgumentException - */ - public function __construct($callable, $context = null) - { - if (!is_callable($callable)) { - throw new InvalidArgumentException('Argument must be callable'); - } - - $this->callable = $callable; - $this->context = $context; - } - - public function transfer(array $batch) - { - return empty($batch) ? null : call_user_func($this->callable, $batch, $this->context); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchCommandTransfer.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchCommandTransfer.php deleted file mode 100644 index d55ac7d1f32..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchCommandTransfer.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -use Guzzle\Batch\BatchTransferInterface; -use Guzzle\Batch\BatchDivisorInterface; -use Guzzle\Common\Exception\InvalidArgumentException; -use Guzzle\Service\Command\CommandInterface; -use Guzzle\Service\Exception\InconsistentClientTransferException; - -/** - * Efficiently transfers multiple commands in parallel per client - * This class is to be used with {@see Guzzle\Batch\BatchInterface} - */ -class BatchCommandTransfer implements BatchTransferInterface, BatchDivisorInterface -{ - /** @var int Size of each command batch */ - protected $batchSize; - - /** - * @param int $batchSize Size of each batch - */ - public function __construct($batchSize = 50) - { - $this->batchSize = $batchSize; - } - - /** - * Creates batches by grouping commands by their associated client - * {@inheritdoc} - */ - public function createBatches(\SplQueue $queue) - { - $groups = new \SplObjectStorage(); - foreach ($queue as $item) { - if (!$item instanceof CommandInterface) { - throw new InvalidArgumentException('All items must implement Guzzle\Service\Command\CommandInterface'); - } - $client = $item->getClient(); - if (!$groups->contains($client)) { - $groups->attach($client, new \ArrayObject(array($item))); - } else { - $groups[$client]->append($item); - } - } - - $batches = array(); - foreach ($groups as $batch) { - $batches = array_merge($batches, array_chunk($groups[$batch]->getArrayCopy(), $this->batchSize)); - } - - return $batches; - } - - public function transfer(array $batch) - { - if (empty($batch)) { - return; - } - - // Get the client of the first found command - $client = reset($batch)->getClient(); - - // Keep a list of all commands with invalid clients - $invalid = array_filter($batch, function ($command) use ($client) { - return $command->getClient() !== $client; - }); - - if (!empty($invalid)) { - throw new InconsistentClientTransferException($invalid); - } - - $client->execute($batch); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchDivisorInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchDivisorInterface.php deleted file mode 100644 index 0214f05f4a0..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchDivisorInterface.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -/** - * Interface used for dividing a queue of items into an array of batches - */ -interface BatchDivisorInterface -{ - /** - * Divide a queue of items into an array batches - * - * @param \SplQueue $queue Queue of items to divide into batches. Items are removed as they are iterated. - * - * @return array|\Traversable Returns an array or Traversable object that contains arrays of items to transfer - */ - public function createBatches(\SplQueue $queue); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchInterface.php deleted file mode 100644 index 28ea65c800a..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchInterface.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -/** - * Interface for efficiently transferring items in a queue using batches - */ -interface BatchInterface -{ - /** - * Add an item to the queue - * - * @param mixed $item Item to add - * - * @return self - */ - public function add($item); - - /** - * Flush the batch and transfer the items - * - * @return array Returns an array flushed items - */ - public function flush(); - - /** - * Check if the batch is empty and has further items to transfer - * - * @return bool - */ - public function isEmpty(); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchRequestTransfer.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchRequestTransfer.php deleted file mode 100644 index 4d8489c7057..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchRequestTransfer.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -use Guzzle\Batch\BatchTransferInterface; -use Guzzle\Batch\BatchDivisorInterface; -use Guzzle\Common\Exception\InvalidArgumentException; -use Guzzle\Http\Message\RequestInterface; - -/** - * Batch transfer strategy used to efficiently transfer a batch of requests. - * This class is to be used with {@see Guzzle\Batch\BatchInterface} - */ -class BatchRequestTransfer implements BatchTransferInterface, BatchDivisorInterface -{ - /** @var int Size of each command batch */ - protected $batchSize; - - /** - * Constructor used to specify how large each batch should be - * - * @param int $batchSize Size of each batch - */ - public function __construct($batchSize = 50) - { - $this->batchSize = $batchSize; - } - - /** - * Creates batches of requests by grouping requests by their associated curl multi object. - * {@inheritdoc} - */ - public function createBatches(\SplQueue $queue) - { - // Create batches by client objects - $groups = new \SplObjectStorage(); - foreach ($queue as $item) { - if (!$item instanceof RequestInterface) { - throw new InvalidArgumentException('All items must implement Guzzle\Http\Message\RequestInterface'); - } - $client = $item->getClient(); - if (!$groups->contains($client)) { - $groups->attach($client, array($item)); - } else { - $current = $groups[$client]; - $current[] = $item; - $groups[$client] = $current; - } - } - - $batches = array(); - foreach ($groups as $batch) { - $batches = array_merge($batches, array_chunk($groups[$batch], $this->batchSize)); - } - - return $batches; - } - - public function transfer(array $batch) - { - if ($batch) { - reset($batch)->getClient()->send($batch); - } - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchSizeDivisor.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchSizeDivisor.php deleted file mode 100644 index 67f90a5818e..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchSizeDivisor.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -/** - * Divides batches into smaller batches under a certain size - */ -class BatchSizeDivisor implements BatchDivisorInterface -{ - /** @var int Size of each batch */ - protected $size; - - /** @param int $size Size of each batch */ - public function __construct($size) - { - $this->size = $size; - } - - /** - * Set the size of each batch - * - * @param int $size Size of each batch - * - * @return BatchSizeDivisor - */ - public function setSize($size) - { - $this->size = $size; - - return $this; - } - - /** - * Get the size of each batch - * - * @return int - */ - public function getSize() - { - return $this->size; - } - - public function createBatches(\SplQueue $queue) - { - return array_chunk(iterator_to_array($queue, false), $this->size); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchTransferInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchTransferInterface.php deleted file mode 100644 index 2e0b60dad40..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/BatchTransferInterface.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -/** - * Interface used for transferring batches of items - */ -interface BatchTransferInterface -{ - /** - * Transfer an array of items - * - * @param array $batch Array of items to transfer - */ - public function transfer(array $batch); -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/Exception/BatchTransferException.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/Exception/BatchTransferException.php deleted file mode 100644 index 2e1f8175be5..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/Exception/BatchTransferException.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php - -namespace Guzzle\Batch\Exception; - -use Guzzle\Common\Exception\GuzzleException; -use Guzzle\Batch\BatchTransferInterface as TransferStrategy; -use Guzzle\Batch\BatchDivisorInterface as DivisorStrategy; - -/** - * Exception thrown during a batch transfer - */ -class BatchTransferException extends \Exception implements GuzzleException -{ - /** @var array The batch being sent when the exception occurred */ - protected $batch; - - /** @var TransferStrategy The transfer strategy in use when the exception occurred */ - protected $transferStrategy; - - /** @var DivisorStrategy The divisor strategy in use when the exception occurred */ - protected $divisorStrategy; - - /** @var array Items transferred at the point in which the exception was encountered */ - protected $transferredItems; - - /** - * @param array $batch The batch being sent when the exception occurred - * @param array $transferredItems Items transferred at the point in which the exception was encountered - * @param \Exception $exception Exception encountered - * @param TransferStrategy $transferStrategy The transfer strategy in use when the exception occurred - * @param DivisorStrategy $divisorStrategy The divisor strategy in use when the exception occurred - */ - public function __construct( - array $batch, - array $transferredItems, - \Exception $exception, - TransferStrategy $transferStrategy = null, - DivisorStrategy $divisorStrategy = null - ) { - $this->batch = $batch; - $this->transferredItems = $transferredItems; - $this->transferStrategy = $transferStrategy; - $this->divisorStrategy = $divisorStrategy; - parent::__construct( - 'Exception encountered while transferring batch: ' . $exception->getMessage(), - $exception->getCode(), - $exception - ); - } - - /** - * Get the batch that we being sent when the exception occurred - * - * @return array - */ - public function getBatch() - { - return $this->batch; - } - - /** - * Get the items transferred at the point in which the exception was encountered - * - * @return array - */ - public function getTransferredItems() - { - return $this->transferredItems; - } - - /** - * Get the transfer strategy - * - * @return TransferStrategy - */ - public function getTransferStrategy() - { - return $this->transferStrategy; - } - - /** - * Get the divisor strategy - * - * @return DivisorStrategy - */ - public function getDivisorStrategy() - { - return $this->divisorStrategy; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/ExceptionBufferingBatch.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/ExceptionBufferingBatch.php deleted file mode 100644 index d7a8928857e..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/ExceptionBufferingBatch.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -use Guzzle\Batch\Exception\BatchTransferException; - -/** - * BatchInterface decorator used to buffer exceptions encountered during a transfer. The exceptions can then later be - * processed after a batch flush has completed. - */ -class ExceptionBufferingBatch extends AbstractBatchDecorator -{ - /** @var array Array of BatchTransferException exceptions */ - protected $exceptions = array(); - - public function flush() - { - $items = array(); - - while (!$this->decoratedBatch->isEmpty()) { - try { - $transferredItems = $this->decoratedBatch->flush(); - } catch (BatchTransferException $e) { - $this->exceptions[] = $e; - $transferredItems = $e->getTransferredItems(); - } - $items = array_merge($items, $transferredItems); - } - - return $items; - } - - /** - * Get the buffered exceptions - * - * @return array Array of BatchTransferException objects - */ - public function getExceptions() - { - return $this->exceptions; - } - - /** - * Clear the buffered exceptions - */ - public function clearExceptions() - { - $this->exceptions = array(); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/FlushingBatch.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/FlushingBatch.php deleted file mode 100644 index 367b6842716..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/FlushingBatch.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -/** - * BatchInterface decorator used to add automatic flushing of the queue when the size of the queue reaches a threshold. - */ -class FlushingBatch extends AbstractBatchDecorator -{ - /** @var int The threshold for which to automatically flush */ - protected $threshold; - - /** @var int Current number of items known to be in the queue */ - protected $currentTotal = 0; - - /** - * @param BatchInterface $decoratedBatch BatchInterface that is being decorated - * @param int $threshold Flush when the number in queue matches the threshold - */ - public function __construct(BatchInterface $decoratedBatch, $threshold) - { - $this->threshold = $threshold; - parent::__construct($decoratedBatch); - } - - /** - * Set the auto-flush threshold - * - * @param int $threshold The auto-flush threshold - * - * @return FlushingBatch - */ - public function setThreshold($threshold) - { - $this->threshold = $threshold; - - return $this; - } - - /** - * Get the auto-flush threshold - * - * @return int - */ - public function getThreshold() - { - return $this->threshold; - } - - public function add($item) - { - $this->decoratedBatch->add($item); - if (++$this->currentTotal >= $this->threshold) { - $this->currentTotal = 0; - $this->decoratedBatch->flush(); - } - - return $this; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/HistoryBatch.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/HistoryBatch.php deleted file mode 100644 index e345fdc349c..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/HistoryBatch.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -/** - * BatchInterface decorator used to keep a history of items that were added to the batch. You must clear the history - * manually to remove items from the history. - */ -class HistoryBatch extends AbstractBatchDecorator -{ - /** @var array Items in the history */ - protected $history = array(); - - public function add($item) - { - $this->history[] = $item; - $this->decoratedBatch->add($item); - - return $this; - } - - /** - * Get the batch history - * - * @return array - */ - public function getHistory() - { - return $this->history; - } - - /** - * Clear the batch history - */ - public function clearHistory() - { - $this->history = array(); - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/NotifyingBatch.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/NotifyingBatch.php deleted file mode 100644 index 96d04daa82f..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/NotifyingBatch.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -namespace Guzzle\Batch; - -use Guzzle\Common\Exception\InvalidArgumentException; - -/** - * BatchInterface decorator used to call a method each time flush is called - */ -class NotifyingBatch extends AbstractBatchDecorator -{ - /** @var mixed Callable to call */ - protected $callable; - - /** - * @param BatchInterface $decoratedBatch Batch object to decorate - * @param mixed $callable Callable to call - * - * @throws InvalidArgumentException - */ - public function __construct(BatchInterface $decoratedBatch, $callable) - { - if (!is_callable($callable)) { - throw new InvalidArgumentException('The passed argument is not callable'); - } - - $this->callable = $callable; - parent::__construct($decoratedBatch); - } - - public function flush() - { - $items = $this->decoratedBatch->flush(); - call_user_func($this->callable, $items); - - return $items; - } -} diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/composer.json b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/composer.json deleted file mode 100644 index 12404d381e9..00000000000 --- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Batch/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "guzzle/batch", - "description": "Guzzle batch component for batching requests, commands, or custom transfers", - "homepage": "http://guzzlephp.org/", - "keywords": ["batch", "HTTP", "REST", "guzzle"], - "license": "MIT", - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "require": { - "php": ">=5.3.2", - "guzzle/common": "self.version" - }, - "autoload": { - "psr-0": { "Guzzle\\Batch": "" } - }, - "suggest": { - "guzzle/http": "self.version", - "guzzle/service": "self.version" - }, - "target-dir": "Guzzle/Batch", - "extra": { - "branch-alias": { - "dev-master": "3.7-dev" - } - } -} |