Commit Graph

74 Commits

Author SHA1 Message Date
Fabien Potencier
1aabc5da64 fixed CS 2011-06-08 12:16:48 +02:00
Fabien Potencier
a98046dd44 [Config] added a guard against circular references 2011-06-05 10:52:57 +02:00
Pascal Borreli
404c452c0b [Various] Phpdoc & typos 2011-06-04 15:30:56 +00:00
Johannes M. Schmitt
6f8871d2d7 [SecurityBundle] added validation for check paths 2011-06-01 13:05:34 +02:00
Pascal Borreli
824e48efa7 [Various] Fixed phpdoc 2011-05-29 23:33:36 +00:00
Pascal Borreli
50d5e3e007 [Various] Fixed typos 2011-05-29 22:24:32 +00:00
Aurélien Fredouelle
c0e8db18f9 [Config] fixed phpdoc 2011-05-19 08:05:27 +02:00
Johannes Schmitt
486ecdc6a6 [Config] some exception improvements 2011-05-05 19:43:08 +02:00
Eriksen Costa
164ce5210d capitalized 'boolean' 2011-04-27 02:35:10 -03:00
Victor Berchet
f83e92bf44 Make casting scalar to array consistent 2011-04-26 12:16:35 +02:00
Fabien Potencier
08bf2af455 fixed email 2011-04-24 13:59:46 +02:00
Pascal Borreli
8c0beea677 [Phpdoc] Cleaning/fixing 2011-04-23 15:18:47 +00:00
Pascal Borreli
b5769c52d6 Fixed various typo 2011-04-22 23:12:50 +00:00
Brikou CARRE
e898445b94 removed empty lines/trailing spaces 2011-04-15 21:12:02 +02:00
Kris Wallsmith
672291087c removed a lot of special normalization logic in the configuration by using xml values instead of attributes 2011-04-13 05:59:46 -07:00
Victor Berchet
b640fcb0f0 [Config] Introduction of an ConfigurationInterface 2011-04-05 11:26:28 +02:00
Ryan Weaver
b9883a3bad [Config] Improving the exception when a resource cannot be imported
This improves, for example, the exception one would receive if they tried to import a resource from a bundle that doesn't exist.
Previously, the deep "bundle is not activated" exception would be thrown. That has value, however there is no indication of where
the exception is actually occurring.

In this new implementation, we throw an exception that explains exactly which resource, and from which source resource, cannot be
loaded. The deeper exception is still thrown as a nested exception.

Two caveats:

  * The `HttpKernel::varToString` method was replicated
  * This introduces a new `Exception` class, which allows us to prevent lot's of exceptions from nesting into each other in the case
    that some deeply imported resource cannot be imported (each upstream import that fails doesn't add its own exception).
2011-04-01 18:59:54 -05:00
Kris Wallsmith
c51b716180 [Config] simplified DirectoryResource to only allow one regex 2011-04-01 04:56:50 -07:00
Fabien Potencier
e4a3e0c2c7 [Config] moved from protected to private (WIP) 2011-03-23 19:34:00 +01:00
Sven Paulus
f93e4b2d73 Eleminate the need to manually clear the cache if a new controller file containing routing annotations is added - part II
* add unit tests
* introduce filename filter to DirectoryResource (to restrict change monitoring to a subset of files)
* modify AnnotationDirectoryLoader.php to use filename filter set on Controller\.php$
2011-03-22 09:03:45 +01:00
Miha Vrhovnik
fb814c666b removed unused and undefined namespace and use statement 2011-03-21 10:45:34 +01:00
Miha Vrhovnik
031ffaee6b fixing undefined class UnsetKeyException 2011-03-21 10:33:27 +01:00
Victor Berchet
9fd7d05ecf [Config] Ability to add and override node types without having to subclass NodeBuilder 2011-03-18 00:32:35 +01:00
Victor Berchet
1e0ed22c55 [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-17 16:26:15 +01:00
Fabien Potencier
e0df94cb8b [Config] added the possibility to use a Closure for default values 2011-03-16 09:30:51 +01:00
Fabien Potencier
f4e4a2aa1b refactored ConfigCache and optimized container:debug task 2011-03-14 18:37:25 +01:00
Fabien Potencier
edb620122a fixed some emails 2011-03-11 11:07:11 +01:00
Fabien Potencier
222d4aa89d Merge remote branch 'stof/tree_builder'
* stof/tree_builder:
  Fixed type-hinting and renamed the method to be more semantic
  Removed duplicated code
2011-03-09 22:07:31 +01:00
Fabien Potencier
1de694ffc0 merged 2011-03-09 21:58:43 +01:00
Fabien Potencier
4f0e0a6193 fixed some emails 2011-03-08 15:43:54 +01:00
Fabien Potencier
8716c2ad1e merged 2011-03-08 15:43:02 +01:00
Fabien Potencier
a0caa942e9 [Config] fixed CS 2011-03-08 15:33:46 +01:00
develop
a93aa55199 If you use an annotation resource pointing to a controller directory
in your routing configuration, only existing files in this directory
get tracked for changes in this directory. So if you add a new
controller file in this directory you'd have to manually clear the
cache since the new file gets ignored.
This patch adds a DirectoryResource for this case which tracks all
changes in the given directory (and files and directories contained
within).
2011-03-08 09:49:45 +01:00
Fabien Potencier
8c423edfef replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Fabien Potencier
bbc5f40636 Merge remote branch 'jakzal/FileLocatorTest'
* jakzal/FileLocatorTest:
  [Config] Added missing tests to satisfy 100% test coverage of FileLocator. Made sure that every path returned with locate() is unique.
2011-03-06 10:40:52 +01:00
Jakub Zalas
bdd4194b6f [Config] Added missing tests to satisfy 100% test coverage of FileLocator. Made sure that every path returned with locate() is unique. 2011-03-05 15:24:44 +01:00
Jordi Boggiano
75dbc3a5b8 [Config] Improved exception message a bit 2011-03-01 14:44:24 +01:00
Victor Berchet
d281409ed5 [Config] Define a common interface for NodeBuilder and TreeBuilder 2011-02-28 12:39:43 +01:00
Victor Berchet
6d37218db1 [Config] Tweak type hints & phpDoc for the builders 2011-02-28 12:39:43 +01:00
Victor Berchet
b5fadcd22c [Config][TreeBuilder] Tweak the code 2011-02-28 12:39:22 +01:00
Victor Berchet
6c9e48fd8f [Config][VariableNode] Tweak the code 2011-02-28 12:39:21 +01:00
Victor Berchet
687c4dfeb1 [Config][BooleanNode] Tweak the code 2011-02-28 12:39:21 +01:00
Victor Berchet
e47f808376 [Config] Tweak phpDoc 2011-02-28 12:39:13 +01:00
Victor Berchet
4d83b36170 [Config][ArrayNode] Tweak normalizeValue() code & phpDoc 2011-02-28 10:13:27 +01:00
Victor Berchet
60043a3c96 [Config][ArrayNode] Tweak some phpDoc 2011-02-28 10:12:44 +01:00
Martin Hason
d231a8a8d5 [Config] [DependencyInjection] removed DependencyInjection dependency in Config, fix tests 2011-02-28 09:19:13 +01:00
Christophe Coevoet
a960355c46 Fixed type-hinting and renamed the method to be more semantic 2011-02-27 22:44:44 +01:00
Christophe Coevoet
0f2380af3f Removed duplicated code 2011-02-27 22:43:07 +01:00
Fabien Potencier
d4663505f7 Merge remote branch 'vicb/config'
* vicb/config:
  [Config] Simplify ScalarNode by inheriting from VariableNode
2011-02-27 22:32:11 +01:00
Christophe Coevoet
92bfbf575c Fixed CS 2011-02-27 20:56:29 +01:00