Configuration.php 1.6KB

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