Commit Graph

765 Commits

Author SHA1 Message Date
Bernhard Schussek
2c6c89d898 Merge remote branch 'beberlei/forms' into beberlei-merge 2011-03-20 10:15:59 +01:00
Benjamin Eberlei
b43318ee3e [Form] Add tests for untested classes. 2011-03-19 22:03:49 +01:00
Benjamin Eberlei
d62213662e Merge branch 'experimental' of git://github.com/bschussek/symfony into forms 2011-03-19 20:36:56 +01:00
Benjamin Eberlei
864a3ec45f [Form] Add StripTagsFilter EventListener 2011-03-19 20:36:49 +01:00
Bernhard Schussek
6793bcd698 [Form] Removed magic from method signature of add() 2011-03-19 19:20:55 +01:00
Bernhard Schussek
c4b7a77ece Merge remote branch 'beberlei/forms' into beberlei-merge
Conflicts:
	src/Symfony/Component/Form/Type/Loader/DefaultTypeLoader.php
2011-03-19 19:01:57 +01:00
Benjamin Eberlei
39c2d3f166 [Form] Add PhpTheme that relies on no Template Engine, generalize tests to use for PhpTheme and PhpEngineTheme. Fixed some bugs 2011-03-19 17:47:18 +01:00
Bernhard Schussek
43a24fa931 [Form] Renamed events to match terminology in Field 2011-03-19 16:59:23 +01:00
Bernhard Schussek
7f9284105d [Form] Moved namespace FieldGuesser to Type\Guesser 2011-03-19 16:46:03 +01:00
Bernhard Schussek
89215d167d Merge remote branch 'symfony/master' into experimental 2011-03-19 13:25:41 +01:00
Fabien Potencier
510c30693b [HttpFoundation] fixed a test 2011-03-19 12:29:23 +01:00
everzet
3fd50ea4e6 [Routing] throw an exception if route config has unsupported keys 2011-03-19 12:54:29 +02:00
Kris Wallsmith
e596931dc8 [DomCrawler] enabled removal of form fields to allow emulating javascript in a functional test 2011-03-18 09:39:08 -07:00
Bernhard Schussek
6bc79a1a12 [Form] Renamed different kinds of data transformers within a field for better clarity 2011-03-18 16:59:34 +01:00
Bernhard Schussek
2a1e394352 [Form] Renamed field configs to types. Everywhere else, we are referring to the name of the type as 'type' now (was 'identifier') 2011-03-18 16:20:00 +01:00
Bernhard Schussek
0b929ee342 [Form] Renamed ValueTransformers to DataTransformers to fit with DataMapper and DataValidator 2011-03-18 16:01:06 +01:00
Bernhard Schussek
97d0183d84 [Form] Moved properties propertyPath, modifyByReference, validationGroups and virtual to generic attributes because they are specific to the used data validator/mapper implementations 2011-03-18 15:26:02 +01:00
Bernhard Schussek
700c96e7fa [Form] Moved FieldFactoryTest to FormFactoryTest and fixed it 2011-03-18 14:37:54 +01:00
Bernhard Schussek
9caaf0f3a3 [Form] Introduced FieldBuilder for field/form creation and made Field/Form mostly immutable 2011-03-18 12:50:26 +01:00
Fabien Potencier
f0c558592c Merge remote branch 'everzet/console-formatter-refactoring' 2011-03-18 11:58:05 +01:00
Fabien Potencier
3627eee3c6 Merge remote branch 'vicb/cfg_rebase'
* vicb/cfg_rebase:
  [Config] Ability to add and override node types without having to subclass NodeBuilder
  [DoctrineBundle] Fix some typos
  [SwiftMailerBundle] Fix a merge issue in the configuration
  Tweak PHPDocs in the extension configuration files
  [Config] Component refactoring
2011-03-18 11:41:43 +01:00
Bernhard Schussek
3f70f89339 Merge remote branch 'symfony/master' into experimental
Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php
	src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
	src/Symfony/Component/HttpFoundation/File/UploadedFile.php
2011-03-18 10:39:40 +01:00
Fabien Potencier
136b23ead4 [EventDispatcher] refactored the code
* The array returned by getListeners() now removes the listener hash as the key (as this is an implementation detail)
 * The sort method now guarantees that a listener registered before another will stay in the same order even for the same priority (for BC)
 * Made various optimizations
2011-03-18 09:01:22 +01:00
Fabien Potencier
69d324eca8 [EventDispatcher] added EventDispatcher::removeSubscriber() 2011-03-18 09:00:58 +01:00
Fabien Potencier
9e88fc4e66 Merge remote branch 'kriswallsmith/kernel/uploaded-file-for-test' 2011-03-18 08:02:16 +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
Kris Wallsmith
0a229947a6 [Form] updated tests for changes in HttpFoundation 2011-03-17 16:09:12 -07:00
Kris Wallsmith
ab3b8ac364 [HttpFoundation] cleaned up comments and coding standards, added better exception messages when filesystem functions throw errors, added "moved" arg to UploadedFile constructor, added FileNotFoundException to UploadedFile per the parent constructor 2011-03-17 16:07:53 -07:00
Kris Wallsmith
69609257ac [DomCrawler] updated upload logic to better emulate a real upload by copying the source file to the temp directory 2011-03-17 16:06:47 -07:00
Bernhard Schussek
a51321c264 [Form] Moved validation logic to ValidationListener 2011-03-17 21:47:12 +01:00
Bernhard Schussek
0799662361 [Form] Extracted data mapping logic from Form into ObjectMapperListener 2011-03-17 21:23:59 +01:00
Fabien Potencier
6c8e71c8e7 renamed filterCore* to onCore*
The onCore* events are fired at some pre-defined points during the
handling of a request. At this is more important than the fact
that you can change things from the event.
2011-03-17 17:01:59 +01:00
ever.zet
8b55c239a2 [Console] updated output tests after formatter adding 2011-03-17 17:53:28 +02:00
ever.zet
4fe2efd49e [Console] implemented output formatter to decorate and format output messages 2011-03-17 17:51:49 +02:00
ever.zet
e5700b817b [Console] implemented output formatter style class for defining custom styles 2011-03-17 17:51:25 +02: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
1219b98ec5 renamed some methods in the event dispatcher 2011-03-17 15:27:42 +01:00
Bernhard Schussek
7a63b840f3 [Form] Renamed submit() to bind() 2011-03-17 14:55:26 +01:00
Bernhard Schussek
5bfd02bcd0 [Form] Renamed bind() to bindRequest(). It is now semantically the same as in symfony1 again 2011-03-17 14:51:22 +01:00
Bernhard Schussek
ffa5bd264a [Form] Moved logic of Field::isMultipart() to rendering layer 2011-03-17 14:40:34 +01:00
Bernhard Schussek
50ce0d53a0 [Form] Removed FieldInterface::getDisplayedData(). Use getTransformedData() instead 2011-03-17 14:28:59 +01:00
Bernhard Schussek
f0d841ef8c [Form] Fixed DateTimeToArrayTransformer when transforming empty values and the option 'fields' is set 2011-03-17 14:27:10 +01:00
Bernhard Schussek
1c9a00733f Merge branch 'event-manager' into experimental
Conflicts:
	src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php
	src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php
2011-03-17 13:38:24 +01:00
Bernhard Schussek
466f1b99c5 [Security] Fixed method names in the Firewall listeners 2011-03-17 13:24:23 +01:00
Bernhard Schussek
5f14d8d6aa Merge remote branch 'symfony/master' into event-manager
Conflicts:
	src/Symfony/Bundle/AsseticBundle/CacheWarmer/AssetWriterCacheWarmer.php
	src/Symfony/Bundle/AsseticBundle/Tests/CacheWarmer/AssetWriterCacheWarmerTest.php
	src/Symfony/Bundle/FrameworkBundle/Profiler/ProfilerListener.php
	src/Symfony/Bundle/FrameworkBundle/Resources/config/profiling.xml
	src/Symfony/Component/HttpKernel/HttpKernel.php
	src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php
	src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php
2011-03-17 12:34:12 +01:00
Fabien Potencier
c5c8e57754 [Locale] updated the tests so that we can be green again (previous version always add 2 skipped tests) 2011-03-17 12:20:37 +01:00
Bernhard Schussek
73464f411e Merge remote branch 'Infranology/intl-stub' into intl-stub 2011-03-17 11:20:52 +01:00
Bernhard Schussek
f966c30c8b Merge remote branch 'symfony/master' into intl-stub 2011-03-17 11:20:25 +01:00
Bernhard Schussek
cb283d3783 [Form] Renamed 'key' to 'name'. Removed setKey() totally. 2011-03-17 11:03:10 +01:00
Fabien Potencier
7edb1a5f13 fixed previous commit 2011-03-16 21:39:30 +01:00