Configuration.php 1.5 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\AsseticBundle\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($kernelDebug)
  29. {
  30. $treeBuilder = new TreeBuilder();
  31. $rootNode = $treeBuilder->root('assetic', 'array');
  32. $rootNode
  33. ->booleanNode('debug')->defaultValue($kernelDebug)->end()
  34. ->booleanNode('use_controller')->defaultValue($kernelDebug)->end()
  35. ->scalarNode('document_root')->defaultValue('%kernel.root_dir%/../web')->end()
  36. ->scalarNode('closure')->end()
  37. ->scalarNode('yui')->end()
  38. ->scalarNode('default_javascripts_output')->defaultValue('js/*.js')->end()
  39. ->scalarNode('default_stylesheets_output')->defaultValue('css/*.css')->end();
  40. return $treeBuilder->buildTree();
  41. }
  42. }