Skip to content

Commit

Permalink
Add an option to set clients public (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
edouarddurieux authored Mar 22, 2022
1 parent e735692 commit b272e55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DependencyInjection/BlablacarRedisExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 1 addition & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function getConfigTreeBuilder()
->end()
->end()
->booleanNode('enable_logger')->defaultTrue()->end()
->booleanNode('public')->defaultFalse()->end()
->end()
;

Expand Down

0 comments on commit b272e55

Please sign in to comment.