From 22dc8b4a5ede35011a1cf0b76830a2df030c0254 Mon Sep 17 00:00:00 2001 From: cbeauvoi Date: Wed, 20 Feb 2019 12:19:03 +0100 Subject: [PATCH] debug --- StorageBundle/DependencyInjection/StorageExtension.php | 3 +++ StorageBundle/Ressources/config/services.yaml | 1 + StorageBundle/Storage.php | 7 +++++++ 3 files changed, 11 insertions(+) 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)