This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

898 lines
42 KiB
PHP
Raw Normal View History

[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
<?php
2011-05-31 09:57:06 +01:00
/*
2012-03-31 22:00:32 +01:00
* This file is part of the Symfony package.
2011-05-31 09:57:06 +01:00
*
* (c) Fabien Potencier <fabien@symfony.com>
*
2012-03-31 22:00:32 +01:00
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
2011-05-31 09:57:06 +01:00
*/
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
use Doctrine\Common\Annotations\Annotation;
use Doctrine\Common\Cache\Cache;
use Symfony\Bundle\FullStack;
use Symfony\Component\Asset\Package;
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Form\Form;
use Symfony\Component\Lock\Lock;
use Symfony\Component\Lock\Store\SemaphoreStore;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Validator\Validation;
2017-04-04 12:58:36 +01:00
use Symfony\Component\WebLink\HttpHeaderSerializer;
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
/**
* FrameworkExtension configuration structure.
*
* @author Jeremy Mikola <jmikola@gmail.com>
*/
class Configuration implements ConfigurationInterface
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
{
2014-05-10 23:14:12 +01:00
private $debug;
/**
* @param bool $debug Whether debugging is enabled or not
*/
2017-10-28 19:15:32 +01:00
public function __construct(bool $debug)
2014-05-10 23:14:12 +01:00
{
2017-10-28 19:15:32 +01:00
$this->debug = $debug;
2014-05-10 23:14:12 +01:00
}
/**
* Generates the configuration tree builder.
*
* @return TreeBuilder The tree builder
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
*/
public function getConfigTreeBuilder()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
{
$treeBuilder = new TreeBuilder();
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
$rootNode = $treeBuilder->root('framework');
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
$rootNode
->beforeNormalization()
->ifTrue(function ($v) { return !isset($v['assets']) && isset($v['templating']) && class_exists(Package::class); })
->then(function ($v) {
$v['assets'] = array();
return $v;
})
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
->scalarNode('secret')->end()
->scalarNode('http_method_override')
->info("Set true to enable support for the '_method' request parameter to determine the intended HTTP method on POST requests. Note: When using the HttpCache, you need to call the method in your front controller instead")
->defaultTrue()
->end()
->scalarNode('ide')->defaultNull()->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->booleanNode('test')->end()
->scalarNode('default_locale')->defaultValue('en')->end()
2013-08-06 08:14:49 +01:00
->arrayNode('trusted_hosts')
->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end()
2013-08-06 08:14:49 +01:00
->prototype('scalar')->end()
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
;
$this->addCsrfSection($rootNode);
$this->addFormSection($rootNode);
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
$this->addEsiSection($rootNode);
2014-03-23 00:04:57 +00:00
$this->addSsiSection($rootNode);
$this->addFragmentsSection($rootNode);
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
$this->addProfilerSection($rootNode);
2016-03-25 15:43:30 +00:00
$this->addWorkflowSection($rootNode);
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
$this->addRouterSection($rootNode);
$this->addSessionSection($rootNode);
$this->addRequestSection($rootNode);
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
$this->addTemplatingSection($rootNode);
2014-12-28 18:57:17 +00:00
$this->addAssetsSection($rootNode);
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
$this->addTranslatorSection($rootNode);
$this->addValidationSection($rootNode);
$this->addAnnotationsSection($rootNode);
2013-01-20 18:39:49 +00:00
$this->addSerializerSection($rootNode);
$this->addPropertyAccessSection($rootNode);
2015-09-28 12:22:50 +01:00
$this->addPropertyInfoSection($rootNode);
$this->addCacheSection($rootNode);
$this->addPhpErrorsSection($rootNode);
2017-04-04 12:58:36 +01:00
$this->addWebLinkSection($rootNode);
$this->addLockSection($rootNode);
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
return $treeBuilder;
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
}
private function addCsrfSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('csrf_protection')
->canBeEnabled()
->end()
->end()
;
}
private function addFormSection(ArrayNodeDefinition $rootNode)
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
{
$rootNode
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
2012-01-24 20:51:23 +00:00
->arrayNode('form')
->info('form configuration')
->{!class_exists(FullStack::class) && class_exists(Form::class) ? 'canBeDisabled' : 'canBeEnabled'}()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
->arrayNode('csrf_protection')
->treatFalseLike(array('enabled' => false))
->treatTrueLike(array('enabled' => true))
->treatNullLike(array('enabled' => true))
->addDefaultsIfNotSet()
->children()
->booleanNode('enabled')->defaultNull()->end() // defaults to framework.csrf_protection.enabled
->scalarNode('field_name')->defaultValue('_token')->end()
->end()
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
;
}
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
private function addEsiSection(ArrayNodeDefinition $rootNode)
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
{
$rootNode
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
2012-01-24 20:51:23 +00:00
->arrayNode('esi')
->info('esi configuration')
->canBeEnabled()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
;
}
2014-03-23 00:04:57 +00:00
private function addSsiSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('ssi')
->info('ssi configuration')
->canBeEnabled()
->end()
->end();
}
private function addFragmentsSection(ArrayNodeDefinition $rootNode)
2013-01-22 09:24:26 +00:00
{
$rootNode
->children()
->arrayNode('fragments')
->info('fragments configuration')
->canBeEnabled()
2013-01-22 09:24:26 +00:00
->children()
->scalarNode('path')->defaultValue('/_fragment')->end()
2013-01-22 09:24:26 +00:00
->end()
->end()
->end()
;
}
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
private function addProfilerSection(ArrayNodeDefinition $rootNode)
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
{
$rootNode
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
2012-01-24 20:51:23 +00:00
->arrayNode('profiler')
->info('profiler configuration')
->canBeEnabled()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
->booleanNode('collect')->defaultTrue()->end()
->booleanNode('only_exceptions')->defaultFalse()->end()
->booleanNode('only_master_requests')->defaultFalse()->end()
->scalarNode('dsn')->defaultValue('file:%kernel.cache_dir%/profiler')->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
->end()
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
;
}
2016-03-25 15:43:30 +00:00
private function addWorkflowSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->fixXmlConfig('workflow')
2016-03-25 15:43:30 +00:00
->children()
->arrayNode('workflows')
->canBeEnabled()
->beforeNormalization()
->always(function ($v) {
if (true === $v['enabled']) {
$workflows = $v;
unset($workflows['enabled']);
2017-09-11 18:58:01 +01:00
if (1 === count($workflows) && isset($workflows[0]['enabled'])) {
$workflows = array();
}
$v = array(
'enabled' => true,
'workflows' => $workflows,
);
}
return $v;
})
->end()
->children()
->arrayNode('workflows')
->useAttributeAsKey('name')
->prototype('array')
->fixXmlConfig('support')
->fixXmlConfig('place')
->fixXmlConfig('transition')
2016-03-25 15:43:30 +00:00
->children()
->arrayNode('audit_trail')
->canBeEnabled()
->end()
2016-03-25 15:43:30 +00:00
->enumNode('type')
->values(array('workflow', 'state_machine'))
->defaultValue('state_machine')
->end()
->arrayNode('marking_store')
->fixXmlConfig('argument')
->children()
->enumNode('type')
->values(array('multiple_state', 'single_state'))
->end()
->arrayNode('arguments')
->beforeNormalization()
->ifString()
->then(function ($v) { return array($v); })
->end()
->requiresAtLeastOneElement()
->prototype('scalar')
->end()
->end()
->scalarNode('service')
->cannotBeEmpty()
->end()
->end()
->validate()
->ifTrue(function ($v) { return isset($v['type']) && isset($v['service']); })
->thenInvalid('"type" and "service" cannot be used together.')
->end()
->validate()
->ifTrue(function ($v) { return !empty($v['arguments']) && isset($v['service']); })
->thenInvalid('"arguments" and "service" cannot be used together.')
->end()
2016-03-25 15:43:30 +00:00
->end()
->arrayNode('supports')
2016-03-25 15:43:30 +00:00
->beforeNormalization()
->ifString()
->then(function ($v) { return array($v); })
->end()
->prototype('scalar')
->cannotBeEmpty()
->validate()
->ifTrue(function ($v) { return !class_exists($v); })
->thenInvalid('The supported class %s does not exist.')
->end()
2016-03-25 15:43:30 +00:00
->end()
->end()
->scalarNode('support_strategy')
2016-03-25 15:43:30 +00:00
->cannotBeEmpty()
->end()
->scalarNode('initial_place')
->defaultNull()
2016-03-25 15:43:30 +00:00
->end()
->arrayNode('places')
->isRequired()
->requiresAtLeastOneElement()
->prototype('scalar')
->cannotBeEmpty()
->end()
->end()
->arrayNode('transitions')
->beforeNormalization()
->always()
->then(function ($transitions) {
// It's an indexed array, we let the validation occurs
if (isset($transitions[0])) {
return $transitions;
}
foreach ($transitions as $name => $transition) {
if (array_key_exists('name', $transition)) {
continue;
}
$transition['name'] = $name;
$transitions[$name] = $transition;
}
return $transitions;
})
2016-03-25 15:43:30 +00:00
->end()
->isRequired()
->requiresAtLeastOneElement()
->prototype('array')
->children()
->scalarNode('name')
->isRequired()
->cannotBeEmpty()
->end()
->scalarNode('guard')
->cannotBeEmpty()
->info('An expression to block the transition')
->example('is_fully_authenticated() and has_role(\'ROLE_JOURNALIST\') and subject.getTitle() == \'My first article\'')
->end()
->arrayNode('from')
->beforeNormalization()
->ifString()
->then(function ($v) { return array($v); })
->end()
->requiresAtLeastOneElement()
->prototype('scalar')
->cannotBeEmpty()
->end()
->end()
->arrayNode('to')
->beforeNormalization()
->ifString()
->then(function ($v) { return array($v); })
->end()
->requiresAtLeastOneElement()
->prototype('scalar')
->cannotBeEmpty()
->end()
->end()
2016-03-25 15:43:30 +00:00
->end()
->end()
->end()
->end()
->validate()
->ifTrue(function ($v) {
return $v['supports'] && isset($v['support_strategy']);
})
->thenInvalid('"supports" and "support_strategy" cannot be used together.')
->end()
->validate()
->ifTrue(function ($v) {
return !$v['supports'] && !isset($v['support_strategy']);
})
->thenInvalid('"supports" or "support_strategy" should be configured.')
->end()
2016-03-25 15:43:30 +00:00
->end()
->end()
->end()
->end()
->end()
;
}
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
private function addRouterSection(ArrayNodeDefinition $rootNode)
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
{
$rootNode
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
2012-01-24 20:51:23 +00:00
->arrayNode('router')
->info('router configuration')
->canBeEnabled()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
->scalarNode('resource')->isRequired()->end()
->scalarNode('type')->end()
->scalarNode('http_port')->defaultValue(80)->end()
->scalarNode('https_port')->defaultValue(443)->end()
->scalarNode('strict_requirements')
2012-06-11 11:04:41 +01:00
->info(
"set to true to throw an exception when a parameter does not match the requirements\n".
"set to false to disable exceptions when a parameter does not match the requirements (and return null instead)\n".
"set to null to disable parameter checks against requirements\n".
"'true' is the preferred configuration in development mode, while 'false' or 'null' might be preferred in production"
2012-06-11 11:04:41 +01:00
)
->defaultTrue()
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
;
}
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
private function addSessionSection(ArrayNodeDefinition $rootNode)
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
{
$rootNode
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
2012-01-24 20:51:23 +00:00
->arrayNode('session')
->info('session configuration')
->canBeEnabled()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
->scalarNode('storage_id')->defaultValue('session.storage.native')->end()
->scalarNode('handler_id')->defaultValue('session.handler.native_file')->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->scalarNode('name')->end()
->scalarNode('cookie_lifetime')->end()
->scalarNode('cookie_path')->end()
->scalarNode('cookie_domain')->end()
->booleanNode('cookie_secure')->end()
->booleanNode('cookie_httponly')->defaultTrue()->end()
->booleanNode('use_cookies')->end()
->scalarNode('gc_divisor')->end()
->scalarNode('gc_probability')->defaultValue(1)->end()
->scalarNode('gc_maxlifetime')->end()
->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
->integerNode('metadata_update_threshold')
->defaultValue('0')
->info('seconds to wait between 2 session metadata updates')
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
->end()
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
;
}
private function addRequestSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('request')
->info('request configuration')
->canBeEnabled()
->fixXmlConfig('format')
->children()
->arrayNode('formats')
->useAttributeAsKey('name')
->prototype('array')
->beforeNormalization()
->ifTrue(function ($v) { return is_array($v) && isset($v['mime_type']); })
->then(function ($v) { return $v['mime_type']; })
->end()
->beforeNormalization()
->ifTrue(function ($v) { return !is_array($v); })
->then(function ($v) { return array($v); })
->end()
->prototype('scalar')->end()
->end()
->end()
->end()
->end()
->end()
;
}
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
private function addTemplatingSection(ArrayNodeDefinition $rootNode)
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
{
$rootNode
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
2012-01-24 20:51:23 +00:00
->arrayNode('templating')
->info('templating configuration')
->canBeEnabled()
->beforeNormalization()
->ifTrue(function ($v) { return false === $v || is_array($v) && false === $v['enabled']; })
->then(function () { return array('enabled' => false, 'engines' => false); })
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
->scalarNode('hinclude_default_template')->defaultNull()->end()
2015-02-12 09:20:19 +00:00
->scalarNode('cache')->end()
->arrayNode('form')
->addDefaultsIfNotSet()
->fixXmlConfig('resource')
->children()
->arrayNode('resources')
2012-02-20 18:15:01 +00:00
->addDefaultChildrenIfNoneSet()
->prototype('scalar')->defaultValue('FrameworkBundle:Form')->end()
->validate()
->ifTrue(function ($v) {return !in_array('FrameworkBundle:Form', $v); })
2013-12-28 07:46:05 +00:00
->then(function ($v) {
return array_merge(array('FrameworkBundle:Form'), $v);
})
->end()
->end()
->end()
->end()
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->fixXmlConfig('engine')
->children()
->arrayNode('engines')
->example(array('twig'))
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->isRequired()
->requiresAtLeastOneElement()
->canBeUnset()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->beforeNormalization()
->ifTrue(function ($v) { return !is_array($v) && false !== $v; })
2013-12-28 07:46:05 +00:00
->then(function ($v) { return array($v); })
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
->prototype('scalar')->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
->end()
->fixXmlConfig('loader')
->children()
->arrayNode('loaders')
->beforeNormalization()
2013-12-28 07:46:05 +00:00
->ifTrue(function ($v) { return !is_array($v); })
->then(function ($v) { return array($v); })
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
->prototype('scalar')->end()
->end()
->end()
2014-12-28 18:57:17 +00:00
->end()
->end()
;
}
private function addAssetsSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('assets')
->info('assets configuration')
->{!class_exists(FullStack::class) && class_exists(Package::class) ? 'canBeDisabled' : 'canBeEnabled'}()
2014-12-28 18:57:17 +00:00
->fixXmlConfig('base_url')
->children()
2016-01-25 21:22:29 +00:00
->scalarNode('version_strategy')->defaultNull()->end()
2014-12-28 18:57:17 +00:00
->scalarNode('version')->defaultNull()->end()
->scalarNode('version_format')->defaultValue('%%s?%%s')->end()
->scalarNode('json_manifest_path')->defaultNull()->end()
2014-12-28 18:57:17 +00:00
->scalarNode('base_path')->defaultValue('')->end()
->arrayNode('base_urls')
->requiresAtLeastOneElement()
->beforeNormalization()
->ifTrue(function ($v) { return !is_array($v); })
->then(function ($v) { return array($v); })
->end()
->prototype('scalar')->end()
->end()
->end()
2016-01-25 21:22:29 +00:00
->validate()
->ifTrue(function ($v) {
Merge branch '3.0' * 3.0: (105 commits) [Console] remove readline support bumped Symfony version to 3.0.3 updated VERSION for 3.0.2 updated CHANGELOG for 3.0.2 [Routing] added a suggestion to add the HttpFoundation component. [FrameworkBundle] fix assets and templating tests [ClassLoader] fix ApcClassLoader tests on HHVM [travis] Add some comments changed operator from and to && [DependencyInjection] Remove unused parameter [Process] Fix transient tests for incremental outputs [Console] Add missing `@require` annotation in test Fix merge [appveyor] Fix failure reporting [#17634] move DebugBundle license file Limit Ldap component version for the 3.0 branch backport GlobTest from 2.7 branch Move licenses according to new best practices [FrameworkBundle] Remove unused code in test [2.3] Fixed an undefined variable in Glob::toRegex ... Conflicts: .travis.yml composer.json src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/assets.xml src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/assets.yml src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig src/Symfony/Component/Console/CHANGELOG.md src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/PropertyInfo/Tests/PropertyInfoExtractorTest.php src/Symfony/Component/Yaml/Tests/ParserTest.php
2016-02-04 12:57:09 +00:00
return isset($v['version_strategy']) && isset($v['version']);
2016-01-25 21:22:29 +00:00
})
->thenInvalid('You cannot use both "version_strategy" and "version" at the same time under "assets".')
->end()
->validate()
->ifTrue(function ($v) {
return isset($v['version_strategy']) && isset($v['json_manifest_path']);
})
->thenInvalid('You cannot use both "version_strategy" and "json_manifest_path" at the same time under "assets".')
->end()
->validate()
->ifTrue(function ($v) {
return isset($v['version']) && isset($v['json_manifest_path']);
})
->thenInvalid('You cannot use both "version" and "json_manifest_path" at the same time under "assets".')
->end()
2014-12-28 18:57:17 +00:00
->fixXmlConfig('package')
->children()
->arrayNode('packages')
->useAttributeAsKey('name')
->prototype('array')
->fixXmlConfig('base_url')
->children()
2016-01-25 21:22:29 +00:00
->scalarNode('version_strategy')->defaultNull()->end()
->scalarNode('version')
->beforeNormalization()
->ifTrue(function ($v) { return '' === $v; })
->then(function ($v) { return; })
->end()
->end()
2014-12-28 18:57:17 +00:00
->scalarNode('version_format')->defaultNull()->end()
->scalarNode('json_manifest_path')->defaultNull()->end()
2014-12-28 18:57:17 +00:00
->scalarNode('base_path')->defaultValue('')->end()
->arrayNode('base_urls')
->requiresAtLeastOneElement()
->beforeNormalization()
->ifTrue(function ($v) { return !is_array($v); })
->then(function ($v) { return array($v); })
->end()
->prototype('scalar')->end()
->end()
->end()
2016-01-25 21:22:29 +00:00
->validate()
->ifTrue(function ($v) {
Merge branch '3.0' * 3.0: (105 commits) [Console] remove readline support bumped Symfony version to 3.0.3 updated VERSION for 3.0.2 updated CHANGELOG for 3.0.2 [Routing] added a suggestion to add the HttpFoundation component. [FrameworkBundle] fix assets and templating tests [ClassLoader] fix ApcClassLoader tests on HHVM [travis] Add some comments changed operator from and to && [DependencyInjection] Remove unused parameter [Process] Fix transient tests for incremental outputs [Console] Add missing `@require` annotation in test Fix merge [appveyor] Fix failure reporting [#17634] move DebugBundle license file Limit Ldap component version for the 3.0 branch backport GlobTest from 2.7 branch Move licenses according to new best practices [FrameworkBundle] Remove unused code in test [2.3] Fixed an undefined variable in Glob::toRegex ... Conflicts: .travis.yml composer.json src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/assets.xml src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/assets.yml src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig src/Symfony/Component/Console/CHANGELOG.md src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/PropertyInfo/Tests/PropertyInfoExtractorTest.php src/Symfony/Component/Yaml/Tests/ParserTest.php
2016-02-04 12:57:09 +00:00
return isset($v['version_strategy']) && isset($v['version']);
2016-01-25 21:22:29 +00:00
})
->thenInvalid('You cannot use both "version_strategy" and "version" at the same time under "assets" packages.')
->end()
->validate()
->ifTrue(function ($v) {
return isset($v['version_strategy']) && isset($v['json_manifest_path']);
})
->thenInvalid('You cannot use both "version_strategy" and "json_manifest_path" at the same time under "assets" packages.')
->end()
->validate()
->ifTrue(function ($v) {
return isset($v['version']) && isset($v['json_manifest_path']);
})
->thenInvalid('You cannot use both "version" and "json_manifest_path" at the same time under "assets" packages.')
->end()
2014-12-28 18:57:17 +00:00
->end()
->end()
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
;
}
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
private function addTranslatorSection(ArrayNodeDefinition $rootNode)
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
{
$rootNode
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
2012-01-24 20:51:23 +00:00
->arrayNode('translator')
->info('translator configuration')
->{!class_exists(FullStack::class) && class_exists(Translator::class) ? 'canBeDisabled' : 'canBeEnabled'}()
->fixXmlConfig('fallback')
->fixXmlConfig('path')
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
->arrayNode('fallbacks')
->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end()
->prototype('scalar')->end()
->defaultValue(array('en'))
->end()
->booleanNode('logging')->defaultValue(false)->end()
->scalarNode('formatter')->defaultValue('translator.formatter.default')->end()
->scalarNode('default_path')
->info('The default path used to load translations')
2017-11-21 14:08:09 +00:00
->defaultValue('%kernel.project_dir%/translations')
->end()
->arrayNode('paths')
->prototype('scalar')->end()
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
;
}
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
private function addValidationSection(ArrayNodeDefinition $rootNode)
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
{
$rootNode
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
2012-01-24 20:51:23 +00:00
->arrayNode('validation')
->info('validation configuration')
->{!class_exists(FullStack::class) && class_exists(Validation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
2017-12-12 19:30:26 +00:00
->validate()
->ifTrue(function ($v) { return isset($v['strict_email']) && isset($v['email_validation_mode']); })
->thenInvalid('"strict_email" and "email_validation_mode" cannot be used together.')
->end()
->beforeNormalization()
->ifTrue(function ($v) { return isset($v['strict_email']); })
->then(function ($v) {
@trigger_error('The "framework.validation.strict_email" configuration key has been deprecated in Symfony 4.1. Use the "framework.validation.email_validation_mode" configuration key instead.', E_USER_DEPRECATED);
return $v;
})
->end()
->beforeNormalization()
->ifTrue(function ($v) { return isset($v['strict_email']) && !isset($v['email_validation_mode']); })
->then(function ($v) {
$v['email_validation_mode'] = $v['strict_email'] ? 'strict' : 'loose';
unset($v['strict_email']);
return $v;
})
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->children()
2017-07-18 12:29:29 +01:00
->scalarNode('cache')->end()
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && class_exists(Annotation::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
->arrayNode('static_method')
->defaultValue(array('loadValidatorMetadata'))
->prototype('scalar')->end()
->treatFalseLike(array())
->validate()
->ifTrue(function ($v) { return !is_array($v); })
->then(function ($v) { return (array) $v; })
->end()
->end()
->scalarNode('translation_domain')->defaultValue('validators')->end()
2017-12-12 19:30:26 +00:00
->booleanNode('strict_email')->end()
->enumNode('email_validation_mode')->values(array('html5', 'loose', 'strict'))->end()
->arrayNode('mapping')
->addDefaultsIfNotSet()
->fixXmlConfig('path')
->children()
->arrayNode('paths')
->prototype('scalar')->end()
->end()
->end()
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
->end()
->end()
[Config] Component refactoring The Config component API have changed and the extension configuration files must be updated accordingly: 1. Array nodes must enclosed their children definition in ->children() ... ->end() calls: Before: $treeBuilder->root('zend', 'array') ->arrayNode('logger') ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end(); After: $treeBuilder->root('zend', 'array') ->children() ->arrayNode('logger') ->children() ->scalarNode('priority')->defaultValue('INFO')->end() ->booleanNode('log_errors')->defaultFalse()->end() ->end() ->end() ->end(); 2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition) Before: $treeBuilder->root('doctrine', 'array') ->arrayNode('dbal') ->builder($this->getDbalConnectionsNode()) ->end(); After: $treeBuilder->root('doctrine', 'array') ->children() ->arrayNode('dbal') ->append($this->getDbalConnectionsNode()) ->end() ->end(); 3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition): Before: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(NodeBuilder $node) { ... } After: $root = $treeBuilder->root('doctrine', 'array'); $this->addDbalSection($root); public function addDbalSection(ArrayNodeDefinition $node) { ... } 4. The NodeBuilder API has changed (this is seldom used): Before: $node = new NodeBuilder('connections', 'array'); After: The recommended way is to use a tree builder: $treeBuilder = new TreeBuilder(); $node = $treeBuilder->root('connections', 'array'); An other way would be: $builder = new NodeBuilder(); $node = $builder->node('connections', 'array'); Some notes: - Tree root nodes should most always be array nodes, so this as been made the default: $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine') - There could be more than one ->children() ... ->end() sections. This could help with the readability: $treeBuilder->root('doctrine') ->children() ->scalarNode('default_connection')->end() ->end() ->fixXmlConfig('type') ->children() ->arrayNode('types') .... ->end() ->end()
2011-03-14 17:29:56 +00:00
->end()
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
;
}
private function addAnnotationsSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
2012-01-24 20:51:23 +00:00
->arrayNode('annotations')
->info('annotation configuration')
->{class_exists(Annotation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
->children()
->scalarNode('cache')->defaultValue(interface_exists(Cache::class) ? 'php_array' : 'none')->end()
2011-05-24 12:29:44 +01:00
->scalarNode('file_cache_dir')->defaultValue('%kernel.cache_dir%/annotations')->end()
2016-03-12 17:49:05 +00:00
->booleanNode('debug')->defaultValue($this->debug)->end()
->end()
->end()
->end()
;
}
2013-01-20 18:39:49 +00:00
private function addSerializerSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('serializer')
->info('serializer configuration')
->{!class_exists(FullStack::class) && class_exists(Serializer::class) ? 'canBeDisabled' : 'canBeEnabled'}()
->children()
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && class_exists(Annotation::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
->scalarNode('name_converter')->end()
->scalarNode('circular_reference_handler')->end()
->arrayNode('mapping')
->addDefaultsIfNotSet()
->fixXmlConfig('path')
->children()
->arrayNode('paths')
->prototype('scalar')->end()
->end()
->end()
->end()
->end()
2013-01-20 18:39:49 +00:00
->end()
->end()
;
}
private function addPropertyAccessSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('property_access')
->addDefaultsIfNotSet()
->info('Property access configuration')
->children()
->booleanNode('magic_call')->defaultFalse()->end()
->booleanNode('throw_exception_on_invalid_index')->defaultFalse()->end()
->end()
->end()
->end()
;
}
2015-09-28 12:22:50 +01:00
private function addPropertyInfoSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('property_info')
->info('Property info configuration')
->canBeEnabled()
->end()
->end()
;
}
private function addCacheSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('cache')
->info('Cache configuration')
->addDefaultsIfNotSet()
->fixXmlConfig('pool')
->children()
->scalarNode('prefix_seed')
->info('Used to namespace cache keys when using several apps with the same shared backend')
->example('my-application-name')
->end()
->scalarNode('app')
->info('App related cache pools configuration')
->defaultValue('cache.adapter.filesystem')
->end()
->scalarNode('system')
->info('System related cache pools configuration')
->defaultValue('cache.adapter.system')
->end()
->scalarNode('directory')->defaultValue('%kernel.cache_dir%/pools')->end()
->scalarNode('default_doctrine_provider')->end()
->scalarNode('default_psr6_provider')->end()
->scalarNode('default_redis_provider')->defaultValue('redis://localhost')->end()
->scalarNode('default_memcached_provider')->defaultValue('memcached://localhost')->end()
->arrayNode('pools')
->useAttributeAsKey('name')
->prototype('array')
->children()
->scalarNode('adapter')->defaultValue('cache.app')->end()
->booleanNode('public')->defaultFalse()->end()
->integerNode('default_lifetime')->end()
->scalarNode('provider')
->info('The service name to use as provider when the specified adapter needs one.')
->end()
->scalarNode('clearer')->end()
->end()
->end()
->validate()
->ifTrue(function ($v) { return isset($v['cache.app']) || isset($v['cache.system']); })
->thenInvalid('"cache.app" and "cache.system" are reserved names')
->end()
->end()
->end()
->end()
->end()
;
}
private function addPhpErrorsSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('php_errors')
->info('PHP errors handling configuration')
->addDefaultsIfNotSet()
->children()
->booleanNode('log')
->info('Use the app logger instead of the PHP logger for logging PHP errors.')
->defaultValue($this->debug)
->treatNullLike($this->debug)
->end()
->booleanNode('throw')
->info('Throw PHP errors as \ErrorException instances.')
->defaultValue($this->debug)
->treatNullLike($this->debug)
->end()
->end()
->end()
->end()
;
}
2017-04-04 12:58:36 +01:00
private function addLockSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('lock')
->info('Lock configuration')
->{!class_exists(FullStack::class) && class_exists(Lock::class) ? 'canBeDisabled' : 'canBeEnabled'}()
->beforeNormalization()
->ifString()->then(function ($v) { return array('enabled' => true, 'resources' => $v); })
->end()
->beforeNormalization()
->ifTrue(function ($v) { return is_array($v) && !isset($v['resources']); })
->then(function ($v) {
$e = $v['enabled'];
unset($v['enabled']);
return array('enabled' => $e, 'resources' => $v);
})
->end()
->addDefaultsIfNotSet()
->fixXmlConfig('resource')
->children()
->arrayNode('resources')
->requiresAtLeastOneElement()
->defaultValue(array('default' => array(class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock')))
->beforeNormalization()
->ifString()->then(function ($v) { return array('default' => $v); })
->end()
->beforeNormalization()
->ifTrue(function ($v) { return is_array($v) && array_keys($v) === range(0, count($v) - 1); })
->then(function ($v) { return array('default' => $v); })
->end()
->prototype('array')
->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end()
->prototype('scalar')->end()
->end()
->end()
->end()
->end()
->end()
;
}
2017-04-04 12:58:36 +01:00
private function addWebLinkSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('web_link')
->info('web links configuration')
->{!class_exists(FullStack::class) && class_exists(HttpHeaderSerializer::class) ? 'canBeDisabled' : 'canBeEnabled'}()
->end()
->end()
;
}
[FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization This fixes some BC problems introduced in f9138d313b83f951cf82a2f7f902a2d6dd14fbb3. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()). Major changes: * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map. * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user). * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled. * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless. Additional small changes: * Added isset()'s, since config options may be unset * Wrap registerXxxConfiguration() calls in isset() checks * Load translation.xml in configLoad(), since it's always required * Default cache_warmer value (!kernel.debug) is determined via Configuration class Things to be fixed: * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix. * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does. * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 09:29:16 +00:00
}