2011-03-30 18:31:32 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the Symfony package.
|
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Symfony\Bundle\WebProfilerBundle\DependencyInjection;
|
|
|
|
|
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
2011-04-05 10:26:28 +01:00
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
2011-03-30 18:31:32 +01:00
|
|
|
|
|
|
|
/**
|
2014-12-21 17:00:50 +00:00
|
|
|
* This class contains the configuration information for the bundle.
|
2011-03-30 18:31:32 +01:00
|
|
|
*
|
|
|
|
* This information is solely responsible for how the different configuration
|
|
|
|
* sections are normalized, and merged.
|
|
|
|
*
|
|
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
*/
|
2011-04-05 10:26:28 +01:00
|
|
|
class Configuration implements ConfigurationInterface
|
2011-03-30 18:31:32 +01:00
|
|
|
{
|
|
|
|
/**
|
2011-04-05 10:26:28 +01:00
|
|
|
* Generates the configuration tree builder.
|
2011-03-30 18:31:32 +01:00
|
|
|
*
|
2014-12-21 16:36:15 +00:00
|
|
|
* @return TreeBuilder The tree builder
|
2011-03-30 18:31:32 +01:00
|
|
|
*/
|
2011-04-05 10:26:28 +01:00
|
|
|
public function getConfigTreeBuilder()
|
2011-03-30 18:31:32 +01:00
|
|
|
{
|
|
|
|
$treeBuilder = new TreeBuilder();
|
2011-03-30 19:03:34 +01:00
|
|
|
$rootNode = $treeBuilder->root('web_profiler');
|
2011-03-30 18:31:32 +01:00
|
|
|
|
|
|
|
$rootNode
|
|
|
|
->children()
|
|
|
|
->booleanNode('toolbar')->defaultFalse()->end()
|
2011-09-16 08:51:17 +01:00
|
|
|
->scalarNode('position')
|
2011-09-06 19:42:14 +01:00
|
|
|
->defaultValue('bottom')
|
2017-09-03 18:39:07 +01:00
|
|
|
->setDeprecated('The "web_profiler.position" configuration key has been deprecated in Symfony 3.4 and it will be removed in 4.0.')
|
2011-09-06 19:42:14 +01:00
|
|
|
->validate()
|
2019-01-16 09:39:14 +00:00
|
|
|
->ifNotInArray(['bottom', 'top'])
|
2011-09-06 19:42:14 +01:00
|
|
|
->thenInvalid('The CSS position %s is not supported')
|
|
|
|
->end()
|
|
|
|
->end()
|
2011-03-31 12:05:20 +01:00
|
|
|
->booleanNode('intercept_redirects')->defaultFalse()->end()
|
2018-02-14 14:19:15 +00:00
|
|
|
->scalarNode('excluded_ajax_paths')->defaultValue('^/((index|app(_[\w]+)?)\.php/)?_wdt')->end()
|
2011-03-30 18:31:32 +01:00
|
|
|
->end()
|
|
|
|
;
|
|
|
|
|
2011-04-05 10:26:28 +01:00
|
|
|
return $treeBuilder;
|
2011-03-30 18:31:32 +01:00
|
|
|
}
|
|
|
|
}
|