1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Dtc\QueueBundle\DependencyInjection; |
4
|
|
|
|
5
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
6
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
7
|
|
|
|
8
|
|
|
class Configuration implements ConfigurationInterface |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* Generates the configuration tree. |
12
|
|
|
* |
13
|
|
|
* @return TreeBuilder |
14
|
|
|
*/ |
15
|
|
|
public function getConfigTreeBuilder() |
16
|
|
|
{ |
17
|
|
|
$treeBuilder = new TreeBuilder(); |
18
|
|
|
$rootNode = $treeBuilder->root('dtc_queue'); |
19
|
|
|
|
20
|
|
|
$rootNode |
21
|
|
|
->children() |
22
|
|
|
->scalarNode('document_manager') |
23
|
|
|
->defaultValue('default') |
24
|
|
|
->cannotBeEmpty() |
25
|
|
|
->end() |
26
|
|
|
->scalarNode('entity_manager') |
27
|
|
|
->defaultValue('default') |
28
|
|
|
->cannotBeEmpty() |
29
|
|
|
->end() |
30
|
|
|
->scalarNode('default_manager') |
31
|
|
|
->defaultValue('mongodb') |
32
|
|
|
->cannotBeEmpty() |
33
|
|
|
->end() |
34
|
|
|
->scalarNode('class_job') |
35
|
|
|
->end() |
36
|
|
|
->scalarNode('class_job_archive') |
37
|
|
|
->end() |
38
|
|
|
->scalarNode('class_run') |
39
|
|
|
->end() |
40
|
|
|
->scalarNode('class_run_archive') |
41
|
|
|
->end() |
42
|
|
|
->arrayNode('beanstalkd') |
43
|
|
|
->children() |
44
|
|
|
->scalarNode('host')->end() |
45
|
|
|
->scalarNode('tube')->end() |
46
|
|
|
->end() |
47
|
|
|
->end() |
48
|
|
|
->arrayNode('rabbit_mq') |
49
|
|
|
->children() |
50
|
|
|
->scalarNode('host')->end() |
51
|
|
|
->scalarNode('port')->end() |
52
|
|
|
->scalarNode('user')->end() |
53
|
|
|
->scalarNode('password')->end() |
54
|
|
|
->scalarNode('vhost')->defaultValue('/')->end() |
55
|
|
|
->booleanNode('ssl')->defaultFalse()->end() |
56
|
|
|
->scalarNode('options')->end() |
57
|
|
|
->scalarNode('ssl_options')->end() |
58
|
|
|
->arrayNode('queue_args') |
59
|
|
|
->addDefaultsIfNotSet() |
60
|
|
|
->children() |
61
|
|
|
->scalarNode('queue')->defaultValue('dtc_queue')->end() |
62
|
|
|
->booleanNode('passive')->defaultFalse()->end() |
63
|
|
|
->booleanNode('durable')->defaultTrue()->end() |
64
|
|
|
->booleanNode('exclusive')->defaultFalse()->end() |
65
|
|
|
->booleanNode('auto_delete')->defaultFalse()->end() |
66
|
|
|
->integerNode('max_priority')->defaultValue(255)->end() |
67
|
|
|
->end() |
68
|
|
|
->end() |
69
|
|
|
->arrayNode('exchange_args') |
70
|
|
|
->addDefaultsIfNotSet() |
71
|
|
|
->children() |
72
|
|
|
->scalarNode('exchange')->defaultValue('dtc_queue_exchange')->end() |
73
|
|
|
->booleanNode('type')->defaultValue('direct')->end() |
74
|
|
|
->booleanNode('passive')->defaultFalse()->end() |
75
|
|
|
->booleanNode('durable')->defaultTrue()->end() |
76
|
|
|
->booleanNode('auto_delete')->defaultFalse()->end() |
77
|
|
|
->end() |
78
|
|
|
->end() |
79
|
|
|
->end() |
80
|
|
|
->end() |
81
|
|
|
->end() |
82
|
|
|
; |
83
|
|
|
|
84
|
|
|
return $treeBuilder; |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|