|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
namespace Sensio\Bundle\FrameworkExtraBundle\DependencyInjection; |
|
|
4 |
|
|
|
5 |
use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
|
|
6 |
|
|
|
7 |
/** |
|
|
8 |
* FrameworkExtraBundle configuration structure. |
|
|
9 |
* |
|
|
10 |
* @author Henrik Bjornskov <hb@peytz.dk> |
|
|
11 |
*/ |
|
|
12 |
class Configuration |
|
|
13 |
{ |
|
|
14 |
/** |
|
|
15 |
* Generates the configuration tree. |
|
|
16 |
* |
|
|
17 |
* @return Symfony\Component\Config\Definition\NodeInterface |
|
|
18 |
*/ |
|
|
19 |
public function getConfigTree() |
|
|
20 |
{ |
|
|
21 |
$treeBuilder = new TreeBuilder(); |
|
|
22 |
$rootNode = $treeBuilder->root('sensio_framework_extra', 'array'); |
|
|
23 |
|
|
|
24 |
$rootNode |
|
|
25 |
->children() |
|
|
26 |
->arrayNode('router') |
|
|
27 |
->addDefaultsIfNotSet() |
|
|
28 |
->children() |
|
|
29 |
->booleanNode('annotations')->defaultTrue()->end() |
|
|
30 |
->end() |
|
|
31 |
->end() |
|
|
32 |
->arrayNode('request') |
|
|
33 |
->addDefaultsIfNotSet() |
|
|
34 |
->children() |
|
|
35 |
->booleanNode('converters')->defaultTrue()->end() |
|
|
36 |
->end() |
|
|
37 |
->end() |
|
|
38 |
->arrayNode('view') |
|
|
39 |
->addDefaultsIfNotSet() |
|
|
40 |
->children() |
|
|
41 |
->booleanNode('annotations')->defaultTrue()->end() |
|
|
42 |
->end() |
|
|
43 |
->end() |
|
|
44 |
->arrayNode('cache') |
|
|
45 |
->addDefaultsIfNotSet() |
|
|
46 |
->children() |
|
|
47 |
->booleanNode('annotations')->defaultTrue()->end() |
|
|
48 |
->end() |
|
|
49 |
->end() |
|
|
50 |
->end() |
|
|
51 |
; |
|
|
52 |
|
|
|
53 |
return $treeBuilder->buildTree(); |
|
|
54 |
} |
|
|
55 |
} |