diff --git a/DependencyInjection/BlablacarRedisExtension.php b/DependencyInjection/BlablacarRedisExtension.php index 7a68e92..8e65253 100644 --- a/DependencyInjection/BlablacarRedisExtension.php +++ b/DependencyInjection/BlablacarRedisExtension.php @@ -45,13 +45,14 @@ public function load(array $configs, ContainerBuilder $container) $baseClientDefinition->addTag('redis.client', array('client_name' => $name)); if (!$enableLogger) { - $container->setDefinition($id, $baseClientDefinition); + $container->setDefinition($id, $baseClientDefinition)->setPublic($config['public']); } else { $container->setDefinition($id.'.base', $baseClientDefinition)->setPublic(false); $container ->setDefinition($id, new ChildDefinition('blablacar_redis.client.logger')) ->replaceArgument(0, new Reference($id.'.base')) + ->setPublic($config['public']) ; $container ->getDefinition('blablacar_redis.data_collector') diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index a01e1dd..eb65da5 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -42,6 +42,7 @@ public function getConfigTreeBuilder() ->end() ->end() ->booleanNode('enable_logger')->defaultTrue()->end() + ->booleanNode('public')->defaultFalse()->end() ->end() ;