Configuration.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien.potencier@symfony-project.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\NodeBuilder;
  12. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  13. /**
  14. * This class contains the configuration information for the bundle
  15. *
  16. * This information is solely responsible for how the different configuration
  17. * sections are normalized, and merged.
  18. *
  19. * @author Christophe Coevoet <stof@notk.org>
  20. */
  21. class Configuration
  22. {
  23. /**
  24. * Generates the configuration tree.
  25. *
  26. * @return \Symfony\Component\Config\Definition\NodeInterface
  27. */
  28. public function getConfigTree()
  29. {
  30. $treeBuilder = new TreeBuilder();
  31. $rootNode = $treeBuilder->root('zend', 'array');
  32. $rootNode
  33. ->arrayNode('logger')
  34. ->canBeUnset()
  35. ->scalarNode('priority')->defaultValue('CRIT')->end()
  36. ->scalarNode('path')->defaultValue('%kernel.logs_dir%/%kernel.environment%.log')->end()
  37. ->booleanNode('log_errors')->defaultFalse()->end()
  38. ->end()
  39. ;
  40. return $treeBuilder->buildTree();
  41. }
  42. }