CompositeFactory.php in AmazonS3 7.2
File
src/CompositeFactory.php
View source
<?php
namespace Drupal\amazons3;
use Guzzle\Service\ClientInterface;
use Guzzle\Service\Command\Factory\ConcreteClassFactory;
use Guzzle\Service\Command\Factory\ServiceDescriptionFactory;
class CompositeFactory extends \Guzzle\Service\Command\Factory\CompositeFactory {
use DrupalAdapter\Module;
public function factory($name, array $args = array()) {
$args = array_merge($args, $this
->module_invoke_all('amazons3_command_prepare', $name, $args));
$this
->drupal_alter('amazons3_command_prepare', $name, $args);
$command = parent::factory($name, $args);
$this
->drupal_alter('amazons3_command', $command);
return $command;
}
public static function getDefaultChain(ClientInterface $client) {
$factories = array();
if ($description = $client
->getDescription()) {
$factories[] = new ServiceDescriptionFactory($description);
}
$factories[] = new ConcreteClassFactory($client);
return new static($factories);
}
}