Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/3rdparty.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'aws/aws-sdk-php/src/MultiRegionClient.php')
-rw-r--r--aws/aws-sdk-php/src/MultiRegionClient.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/aws/aws-sdk-php/src/MultiRegionClient.php b/aws/aws-sdk-php/src/MultiRegionClient.php
index fce855b5..632dfcc6 100644
--- a/aws/aws-sdk-php/src/MultiRegionClient.php
+++ b/aws/aws-sdk-php/src/MultiRegionClient.php
@@ -22,6 +22,8 @@ class MultiRegionClient implements AwsClientInterface
private $handlerList;
/** @var array */
private $aliases;
+ /** @var callable */
+ private $customHandler;
public static function getArguments()
{
@@ -112,6 +114,11 @@ class MultiRegionClient implements AwsClientInterface
list($region, $args) = $this->getRegionFromArgs($command->toArray());
$command = $this->getClientFromPool($region)
->getCommand($command->getName(), $args);
+
+ if ($this->isUseCustomHandler()) {
+ $command->getHandlerList()->setHandler($this->customHandler);
+ }
+
return $this->executeAsync($command);
});
@@ -191,6 +198,16 @@ class MultiRegionClient implements AwsClientInterface
return $this->getClientFromPool()->getEndpoint();
}
+ public function useCustomHandler(callable $handler)
+ {
+ $this->customHandler = $handler;
+ }
+
+ private function isUseCustomHandler()
+ {
+ return isset($this->customHandler);
+ }
+
/**
* @param string $region Omit this argument or pass in an empty string to
* allow the configured client factory to apply the