Skip to content

Commit 81a19ab

Browse files
authored
Merge pull request #10 from ne0h12/master
Configuration option for enable enqueue elastica
2 parents 2322fd5 + 320b618 commit 81a19ab

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function getConfigTreeBuilder()
1616
$rootNode = $tb->root('enqueue_elastica');
1717
$rootNode
1818
->children()
19+
->booleanNode('enabled')->defaultValue(true)->end()
1920
->scalarNode('context')->defaultValue('enqueue.transport.context')->cannotBeEmpty()->end()
2021
->arrayNode('doctrine')
2122
->children()

DependencyInjection/EnqueueElasticaExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ public function load(array $configs, ContainerBuilder $container)
1818
{
1919
$config = $this->processConfiguration(new Configuration(), $configs);
2020

21+
if (!$config['enabled']) {
22+
return;
23+
}
24+
2125
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
2226
$loader->load('services.yml');
2327

0 commit comments

Comments
 (0)