Configuration.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bundle\ZendBundle\DependencyInjection;
  11. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  12. /**
  13. * This class contains the configuration information for the bundle
  14. *
  15. * This information is solely responsible for how the different configuration
  16. * sections are normalized, and merged.
  17. *
  18. * @author Christophe Coevoet <stof@notk.org>
  19. */
  20. class Configuration
  21. {
  22. /**
  23. * Generates the configuration tree.
  24. *
  25. * @return \Symfony\Component\Config\Definition\ArrayNode The config tree
  26. */
  27. public function getConfigTree()
  28. {
  29. $treeBuilder = new TreeBuilder();
  30. $rootNode = $treeBuilder->root('zend');
  31. $rootNode
  32. ->children()
  33. ->arrayNode('logger')
  34. ->canBeUnset()
  35. ->children()
  36. ->scalarNode('priority')->defaultValue('INFO')->end()
  37. ->scalarNode('path')->defaultValue('%kernel.logs_dir%/%kernel.environment%.log')->end()
  38. ->booleanNode('log_errors')->defaultFalse()->end()
  39. ->end()
  40. ->end()
  41. ->end()
  42. ;
  43. return $treeBuilder->buildTree();
  44. }
  45. }