diff --git a/StorageBundle/DependencyInjection/StorageExtension.php b/StorageBundle/DependencyInjection/StorageExtension.php index bd49595..a83b3eb 100644 --- a/StorageBundle/DependencyInjection/StorageExtension.php +++ b/StorageBundle/DependencyInjection/StorageExtension.php @@ -22,6 +22,9 @@ class StorageExtension extends Extension $configuration = $this->getConfiguration($configs, $container); $config = $this->processConfiguration($configuration, $configs); + $definition = $container->getDefinition('bluesquare.storage'); + $definition->setArgument('user_config', $config); + return $config; } diff --git a/StorageBundle/Ressources/config/services.yaml b/StorageBundle/Ressources/config/services.yaml index 51defb8..03ad26c 100644 --- a/StorageBundle/Ressources/config/services.yaml +++ b/StorageBundle/Ressources/config/services.yaml @@ -3,4 +3,5 @@ services: class: Bluesquare\StorageBundle\Storage autowire: true public: true + arguments: [''] Bluesquare\CryptorBundle\Cryptor: '@bluesquare.storage' diff --git a/StorageBundle/Storage.php b/StorageBundle/Storage.php index a060450..4b5ad30 100644 --- a/StorageBundle/Storage.php +++ b/StorageBundle/Storage.php @@ -10,6 +10,13 @@ use Aws\S3\S3Client; */ class Storage { + private $user_config = []; + + public function __construct($user_config) + { + $this->user_config = $user_config; + } + public function get($storage_name) { // TODO: on récupère les infos sur ce storage dans la config utilisateur (config/bluesquare/storage.yaml)