Commit Graph

8538 Commits

Author SHA1 Message Date
Fabien Potencier 3de31c62d6 merged branch snc/session-handler (PR #3436)
Commits
-------

9c8a283 Some \SessionHandlerInterface related documentation updates
9b2de81 Fixed \SessionHandlerInterface in DbalSessionStorage

Discussion
----------

Some \SessionHandlerInterface related updates

---------------------------------------------------------------------------

by snc at 2012-02-23T20:01:51Z

I checked the `Locale` stub in the documentation and it looks like the `\` is not prefixed, so I'll change this, too.

---------------------------------------------------------------------------

by drak at 2012-02-24T07:40:39Z

We really need some tests for the bridge classes, even if they stubs which cause the compiler to at least parse the class, would pick up refactorings like this.
2012-02-27 10:09:42 +01:00
Fabien Potencier d9959af406 merged branch Seldaek/composer_alias (PR #3457)
Commits
-------

bafcaaf Removed version field
f9d9dc7 Add branch-alias for composer

Discussion
----------

Add branch-alias for composer

This should restore the 2.1-dev version (as an alias of dev-master) so that `2.*` or `2.1.*` constraints work again. I'll adjust packagist soon to also display those aliases.
2012-02-27 10:07:31 +01:00
Fabien Potencier e7b17ce6c8 merged branch dlsniper/patch-1 (PR #3447)
Commits
-------

eb58dd1 Removed useless parameter from Memcached::set()

Discussion
----------

Removed useless parameter from Memcached::set() which makes users unable to set session expiry time.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

The parameter count is wrong so it makes setting session expiration useless.

---------------------------------------------------------------------------

by stof at 2012-02-25T16:06:16Z

Already fixed in 15c6ba93f

---------------------------------------------------------------------------

by stof at 2012-02-25T16:06:46Z

ah sorry, it was the profiler storage
2012-02-27 10:05:08 +01:00
Fabien Potencier c319ff5939 merged branch kriswallsmith/wdt/no-session-fix (PR #3444)
Commits
-------

95ec4eb [WebProfilerBundle] fixed session assumption

Discussion
----------

[WebProfilerBundle] fixed session assumption

```
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```

[![Build Status](https://secure.travis-ci.org/kriswallsmith/symfony.png?branch=wdt/no-session-fix)](http://travis-ci.org/kriswallsmith/symfony)
2012-02-27 10:04:49 +01:00
Fabien Potencier 518b96e7db merged branch Seldaek/fixtests (PR #3443)
Commits
-------

d95d63d Ignore destructive memcached tests by default

Discussion
----------

Ignore destructive memcached tests by default

Follow up for #3438
2012-02-27 10:03:51 +01:00
Fabien Potencier b3da94d0e3 merged branch Seldaek/router_def (PR #3437)
Commits
-------

09b1bd5 [HttpKernel] Remove the _controller since it is not a route parameter part of the url

Discussion
----------

[HttpKernel] Remove the _controller since it is not a route parameter part of the URL

There is no reason for the _controller to be there, the whole idea behind this _route_params thing was to help re-generating the current page's URL, you can easily grab the _route + _route_params and reconstruct it without having lots of garbage as query parameters like `?_controller=Foo::..`

---------------------------------------------------------------------------

by fabpot at 2012-02-24T10:29:01Z

I agree but isn't it a BC break? I mean, someone may rely on `_controller` in his code.

---------------------------------------------------------------------------

by Seldaek at 2012-02-24T11:45:46Z

This is a new 2.1 feature AFAIK so no it's not breaking anything. If _controller is deemed necessary then we should add it on the attributes, but not in the _route_params IMO.

---------------------------------------------------------------------------

by stof at 2012-02-24T13:32:41Z

indeed, ``_route_params`` is new in 2.1
2012-02-27 10:03:33 +01:00
Fabien Potencier 3f71012bc8 merged branch pcampr/patch-1 (PR #3448)
Commits
-------

8e90903 fixed small typo in UPGRADE-2.1.md

Discussion
----------

fixed small typo in UPGRADE-2.1.md

just replaced endforeach by endfor in UPGRADE-2.1.md in sample code
2012-02-27 10:03:00 +01:00
Fabien Potencier 6ad1fc88fe merged branch shieldo/patch-2 (PR #3459)
Commits
-------

54f1a94 [Routing] fixed incorrect grammar in docblock

Discussion
----------

[Routing] fixed incorrect grammar in docblock
2012-02-27 10:01:05 +01:00
Jordi Boggiano bafcaafbe6 Removed version field 2012-02-27 09:59:20 +01:00
Douglas Greenshields 54f1a943b2 [Routing] fixed incorrect grammar in docblock 2012-02-26 22:31:30 +00:00
Fabien Potencier 07edc3ee03 merged 2.0 2012-02-26 14:24:21 +01:00
Pavel Campr 8e90903f2f fixed small typo in UPGRADE-2.1.md 2012-02-25 16:44:52 +01:00
Florin Patan eb58dd1485 Removed useless parameter from Memcached::set() 2012-02-25 17:34:02 +02:00
Jordi Boggiano f9d9dc7ce9 Add branch-alias for composer 2012-02-25 03:26:20 +01:00
Fabien Potencier 2d4fb8ad50 updated VERSION for 2.0.11 2012-02-24 22:59:39 +01:00
Fabien Potencier 51ba6ffc6d updated CHANGELOG for 2.0.11 2012-02-24 22:59:05 +01:00
Fabien Potencier 71b62276d3 fixed a test 2012-02-24 22:55:48 +01:00
Jordi Boggiano 3e64d36cbd [Serializer] Fix XML decoding attack vector through external entities 2012-02-24 22:50:04 +01:00
Kris Wallsmith 95ec4eb5e2 [WebProfilerBundle] fixed session assumption 2012-02-24 05:14:10 -08:00
Jordi Boggiano d95d63d24d Ignore destructive memcached tests by default 2012-02-24 13:37:42 +01:00
Fabien Potencier 3223f51bb1 merged branch pcampr/patch-1 (PR #3439)
Commits
-------

15910a0 fixed coding standards
24a3cd3 Finder - allow sorting when searching in multiple directories

Discussion
----------

[Finder] not searching in multiple dirs with sorting

I hit on a problem with **Finder, when using array of directories passed to ->in() together with sorting** (e.g. ->sortByName()):

*Catchable Fatal Error: Argument 1 passed to AppendIterator::append() must implement interface Iterator, instance of Symfony\Component\Finder\Iterator\SortableIterator given in ......\vendor\symfony\src\Symfony\Component\Finder\Finder.php line 421*

The problem is in Finder.php, line 419. When more than 1 directory is used, \AppendIterator is used to merge iterators for each directory. AppendIterator->append() accepts only objects implementing Iterator interface. But this is broken for SortableIterator, which implements IteratorAggregate and NOT Iterator.

My proposed solution retrieves an Iterator from IteratorAggregate, which is later valid as an input to AppendIterator->append()

(This solved the exception mentioned aboved in my testing project, not tested more.)
2012-02-24 11:34:01 +01:00
Fabien Potencier a1370c97d5 merged branch Seldaek/fixtests (PR #3438)
Commits
-------

e67f8d4 Properly skip memcached tests when no memcached server is present
005d86f Broaden timer tests limits
001c4fd Fix windows fs tests

Discussion
----------

Fix tests

- Some windows fixes
- Skip memcached for real when it's not there - by the way I think those tests are insane since they seem to run a purge() on the memcached server. If you run this by accident somewhere where it matters it could hurt. I think they should be put in a group disabled by default, I'll be happy to add that change if it's deemed useful.
- Fixed the timer tests for good on windows (which seems to be quite bad at `usleep`). I also documented them so you actually know how it failed when it does, the false instead of true wasn't super useful.
2012-02-24 11:31:25 +01:00
Fabien Potencier 6af6531bfb merged branch kriswallsmith/doctrine/proxy-loader-fix (PR #3419)
Commits
-------

6e75fd1 Resolves issue with spl_autoload_register creating new copies of the container and passing that into the closure.

Discussion
----------

[DoctrineBundle] fixed proxy loader memory leak

[![Build Status](https://secure.travis-ci.org/kriswallsmith/symfony.png?branch=doctrine/proxy-loader-fix)](http://travis-ci.org/kriswallsmith/symfony)

The hack for loading Doctrine proxy classes has an obscure memory leak, fixed here by @jjbohn.

## The Proof

Run this test case before and after this patch:

```php
<?php

namespace Kris\JunkBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class DefaultControllerTest extends WebTestCase
{
    /**
     * @dataProvider asdf
     */
    public function testIndex()
    {
        $client = static::createClient();

        $crawler = $client->request('GET', '/hello/Fabien');

        $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
    }

    public function asdf()
    {
        return array_fill(0, 500, array());
    }
}
```

### Before

```
~/Sites/symfony/standard (2.0) $ phpunit -c app/
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /Users/kriswallsmith/Sites/symfony/standard/app/phpunit.xml.dist

...............................................................  63 / 500 ( 12%)
............................................................... 126 / 500 ( 25%)
............................................................... 189 / 500 ( 37%)
............................................................... 252 / 500 ( 50%)
............................................................... 315 / 500 ( 63%)
............................................................... 378 / 500 ( 75%)
............................................................... 441 / 500 ( 88%)
...........................................................

Time: 31 seconds, Memory: 289.50Mb

OK (500 tests, 500 assertions)
```

### After

```
~/Sites/symfony/standard (2.0) $ phpunit -c app/
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /Users/kriswallsmith/Sites/symfony/standard/app/phpunit.xml.dist

...............................................................  63 / 500 ( 12%)
............................................................... 126 / 500 ( 25%)
............................................................... 189 / 500 ( 37%)
............................................................... 252 / 500 ( 50%)
............................................................... 315 / 500 ( 63%)
............................................................... 378 / 500 ( 75%)
............................................................... 441 / 500 ( 88%)
...........................................................

Time: 40 seconds, Memory: 51.25Mb

OK (500 tests, 500 assertions)
```

## tl;dr

Your test suite will use much less memory — 82% in this case.

```
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```

---------------------------------------------------------------------------

by mvrhov at 2012-02-23T06:25:57Z

IMHO this change warrants a comment inside a source code as somebody might actually try to remove the first by reference assign like stof said.

---------------------------------------------------------------------------

by lsmith77 at 2012-02-23T07:55:48Z

this autoloader sounds like something we also need in the ODM's?

---------------------------------------------------------------------------

by stof at 2012-02-23T08:23:17Z

@lsmith77 if you want to allow unserializing proxies without forcing to generate them before (which would be an issue in debug mode), yeah. But take care that each Doctrine bundle should use a different proxy namespace to allow doing the check (there was some issues for people using both the ORM and the mongo ODM because of this)

---------------------------------------------------------------------------

by lsmith77 at 2012-02-23T08:24:33Z

then maybe this could should be a static method inside the bridge?

---------------------------------------------------------------------------

by beberlei at 2012-02-23T11:50:08Z

I think another side of this problem is that ->boot() ALWAYS adds this method on the autoloading stack. So with N tests you have N more autoloaders on the stack.

---------------------------------------------------------------------------

by pminnieur at 2012-02-23T12:07:00Z

This could be an issue if you use Symfony with Leach as an application server, too. After a while, memory is exhausted in face of `gc_collect_cycles` and `$kernel->boot()` and `$kernel->shutdown()` calls in between each request - which ultimately leads to a segfault after some time. I tried to track down what causes increasing memory usage and I think this could be the error.

---------------------------------------------------------------------------

by beberlei at 2012-02-23T12:28:06Z

its definately the problem, we need to remove the autoloader in shutdown, or move it elsewhere.

---------------------------------------------------------------------------

by lsmith77 at 2012-02-23T14:58:37Z

why isnt this just a setup task for the autoloader just like the annotation registry?

---------------------------------------------------------------------------

by stof at 2012-02-23T16:52:42Z

@lsmith77 because the proxy namespace and the proxy dir are not known in the autoload.php file. They are configured in the config files

---------------------------------------------------------------------------

by fabpot at 2012-02-23T18:05:51Z

The `shutdown()` method is where the autoloader should be removed. Can we include this in this PR as well so that we fix everything once and for all?

---------------------------------------------------------------------------

by kriswallsmith at 2012-02-23T19:12:05Z

The once and for all solution is for the Doctrine O*M projects to provide a ProxyLoader class with register and unregister methods that we call in boot and shutdown. We're not solving anything specific to Symfony here.
2012-02-24 11:29:42 +01:00
Victor Berchet 66d0d3dd4b [FrameworkBundle] Fix a bug in the RedirectableUrlMatcher 2012-02-24 11:26:41 +01:00
Pavel Campr 15910a015b fixed coding standards 2012-02-24 09:04:00 +01:00
Pavel Campr 24a3cd3540 Finder - allow sorting when searching in multiple directories 2012-02-24 01:10:57 +01:00
H. Westphal 9c8a283c73 Some \SessionHandlerInterface related documentation updates 2012-02-23 21:05:53 +01:00
Jordi Boggiano e67f8d4a82 Properly skip memcached tests when no memcached server is present 2012-02-23 20:37:26 +01:00
Jordi Boggiano 005d86f4db Broaden timer tests limits 2012-02-23 20:36:56 +01:00
Jordi Boggiano 001c4fd064 Fix windows fs tests 2012-02-23 20:36:22 +01:00
Jordi Boggiano 09b1bd53b0 [HttpKernel] Remove the _controller since it is not a route parameter part of the url 2012-02-23 20:02:56 +01:00
H. Westphal 9b2de819ff Fixed \SessionHandlerInterface in DbalSessionStorage 2012-02-23 20:02:31 +01:00
Fabien Potencier 88b40e92d8 merged branch jmikola/patch-2 (PR #3433)
Commits
-------

15c6ba9 [HttpKernel] Fix call to Memcached::set() once again

Discussion
----------

[HttpKernel] Fix call to Memcached::set() once again

I originally fixed this in #3358, but it appears #3363 (which touched the same line) was merged soon after.
2012-02-23 19:22:16 +01:00
Jeremy Mikola 15c6ba93f6 [HttpKernel] Fix call to Memcached::set() once again
I originally fixed this in #3358, but it appears #3363 (which touched the same line) was merged soon after.
2012-02-23 13:15:05 -05:00
Fabien Potencier 0ff21973f9 merged branch Seldaek/profiler_route (PR #3426)
Commits
-------

957bbcb [WebProfiler] Add default route to access the profiler more easily

Discussion
----------

[WebProfiler] Add default route to access the profiler more easily

When you have the toolbar disabled, it's pretty annoying to reach the _profiler, I never remember what to type to get something except `/_profiler`. This shows the last ten runs which is quite useful.
2012-02-23 19:11:12 +01:00
Fabien Potencier be92973512 merged branch arnaud-lb/apache-matcher-fixes (PR #3406)
Commits
-------

e6e9b5a [Routing] Return the _route parameter from ApacheUrlMatcher

Discussion
----------

[Routing] Return the _route parameter from ApacheUrlMatcher

---------------------------------------------------------------------------

by fabpot at 2012-02-22T23:13:49Z

Can you squash  your commits before I merge? Thanks.

---------------------------------------------------------------------------

by arnaud-lb at 2012-02-23T09:12:45Z

sure, done
2012-02-23 19:06:54 +01:00
Fabien Potencier 207cdb821d merged branch johnnypeck/patch-1 (PR #3421)
Commits
-------

b36f2c8 "Locate" should be "Locale"

Discussion
----------

"Locate" should be "Locale"

Tiny change for a misspelling.
2012-02-23 19:03:18 +01:00
Jordi Boggiano 957bbcbd15 [WebProfiler] Add default route to access the profiler more easily 2012-02-23 15:21:34 +01:00
Arnaud Le Blanc e6e9b5adbe [Routing] Return the _route parameter from ApacheUrlMatcher 2012-02-23 10:11:35 +01:00
Johnny Peck b36f2c8211 "Locate" should be "Locale" 2012-02-22 23:10:06 -05:00
John Bohn 6e75fd16c8 Resolves issue with spl_autoload_register creating new copies of the container and passing that into the closure. 2012-02-22 16:21:34 -08:00
Fabien Potencier f6b4f89f8f merged branch stof/fix_monolog_processor (PR #3418)
Commits
-------

d02ca25 [MonologBundle] Fixed a bug when adding a processor on a service handler

Discussion
----------

Fix monolog processor

This is the proper bugfix replacing #3417, and adding a test for it
2012-02-23 00:10:20 +01:00
Christophe Coevoet d02ca2512b [MonologBundle] Fixed a bug when adding a processor on a service handler 2012-02-22 22:42:42 +01:00
Fabien Potencier 611b241f56 fixed CS 2012-02-22 19:03:34 +01:00
Fabien Potencier f373085928 merged 2.0 2012-02-22 18:59:56 +01:00
Fabien Potencier 333b4f72fc merged branch stealth35/trans_res_dump (PR #3412)
Commits
-------

bffbb5e typo
b82862a [Translation] Add IcuResFileDumper
8e569dd [Translation] ResourceBundleLoader to IcuRes/DatFileLoader

Discussion
----------

[Translation] Refactor ResourceBundle Translation

Bug fix: no
Feature addition: yes
Backwards compatibility break: yes
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/stealth35/symfony.png?branch=trans_res_dump)](http://travis-ci.org/stealth35/symfony)Fixes the following tickets: -
Todo: -

 - Rename `ResourceBundleLoader` to `IcuResFileLoader` and `IcuDatFileLoader`
 - Proud to announce the `IcuResFileDumper`
2012-02-22 16:48:57 +01:00
Fabien Potencier 7ef09ab28d merged branch vicb/config/proto/default (PR #3403)
Commits
-------

b269e27 [Config] Improve handling of PrototypedArrayNode defaults
4feba09 [Config] implements feedback
bc122bd [Config] Fix nested prototyped array nodes
675e5eb [Config] Take advantage of the new PrototypedArrayNode API in the core bundles
cba2c33 [Config] Improve error messages & extensibility
bca2b0e [Config] Improve PrototypedArrayNode default value management

Discussion
----------

[Config] Improve prototype nodes usability, error messages, extensibility

### First commit

*Before* (you should set multiple defalutValues)

```php
<?php
$root
    ->arrayNode('node')
    ->prototype('array')
        // when the node is not set
        ->defaultValue(array('foo' => 'bar')
        ->children()
            // when the key is not set
            ->scalarNode('foo')->defaultValue('bar')->end()

$root
    ->arrayNode('node')
    ->prototype('array')
        // when the node is not set
        ->defaultValue(array('defaults' => array('foo1' => 'bar1', 'foo2' => 'bar2')
        ->children()
            ->arrayNode('bar')
                // when the node is not set
                ->addDefautsIfNotSet()
                // when some values are not set (node being set)
                ->scalarNode('foo1')->defaultValue('bar1')->end()
                ->scalarNode('foo2')->defaultValue('bar2')->end()
```

*after*

```php
<?php
$root
    ->arrayNode('node')
    ->addDefaultChildrenWhenNoneSet()
    ->prototype('array')
        ->children()
            ->scalarNode('foo')->defaultValue('bar')->end()

$root
    ->arrayNode('node')
    ->addDefaultChildrenWhenNoneSet()
    ->prototype('array')
        ->children()
            ->arrayNode('bar')
                ->scalarNode('foo1')->defaultValue('bar1')->end()
                ->scalarNode('foo2')->defaultValue('bar2')->end()
```

*more* (exclusive configs)

```php
<?php
$root
    ->arrayNode('node')
    // Add a default node named 'defaults'
    ->addDefaultChildrenWhenNoneSet()
    // Add a default node named 'foo'
    ->addDefaultChildrenWhenNoneSet('foo')
    // Add two default nodes named 'foo', 'bar'
    ->addDefaultChildrenWhenNoneSet(array('foo', 'bar'))
    // Add two default nodes
    ->addDefaultChildrenWhenNoneSet(2)
```

### Second commit

Improves error messages (print the path to the error) & extensibility.

@schmittjoh I would appreciate you feedback on both the commits. Do you think a boolean $throw switch on `getNode` would make sense (i.e. to prevent throwing excs in prod ?).

---------------------------------------------------------------------------

by schmittjoh at 2012-02-20T15:43:18Z

The error improvements seem uncontroversial.

I'm not so convinced by the other changes though. What if the prototype is a map and not a simple list?

---------------------------------------------------------------------------

by vicb at 2012-02-20T16:07:51Z

I think there's one caveat left in the code as it is now that I will fix (nested prototypes).

Could you please give me more details on the use case you are referring to ?

You do not have to use the new feature but It can be really helpful [here](https://github.com/symfony/symfony/pull/3225/files#L4R38) for example.

---------------------------------------------------------------------------

by schmittjoh at 2012-02-20T17:20:02Z

What I mean is something like this:

```php
->arrayNode("foo")
    ->useAttributeAsKey("name")
    ->prototype(/* ...
```

---------------------------------------------------------------------------

by vicb at 2012-02-20T17:28:01Z

What would be wrong then ? (that's the use case I link in my previous msg)

---------------------------------------------------------------------------

by schmittjoh at 2012-02-20T17:28:55Z

How would adding defaults look like?

---------------------------------------------------------------------------

by vicb at 2012-02-20T17:36:35Z

Check the "more" part of the PR message.

In the linked use case, it would add a "defaults" server using the default host / port / weight. In this case I do not care about the name but the values are important to help alias the equivalent configs. You can override the "defaults" name by using a parameter.

---------------------------------------------------------------------------

by vicb at 2012-02-20T17:47:27Z

```php
<?php
// [...]
    ->arrayNode('servers')
        ->addDefaultChildrenWhenNodeSet()
        ->useAttributeAsKey('name')
        ->prototype('array')
            ->children()
```

---------------------------------------------------------------------------

by schmittjoh at 2012-02-20T17:47:54Z

What I was thinking about is having two nodes with different default values. Right now, both nodes while having different keys would still have the same default values which does not make much sense to me. However, we can address this in another PR.

One thing that we should fix though is that we should require keys in case of a map, and forbid them in case of a list. It might make sense to split it into different methods. Like the following examples make no sense (but are possible atm):

```php
->arrayNode("foo")
    ->useAttributeAsKey("name")
    ->addDefaultChildrenIfNotSet(5)

->arrayNode("foo")
    ->addDefaultChildrenIfNotSet("foo")
    ->prototype("scalar")->end()
```

Another minor nitpick, please rename "when" to "if".

---------------------------------------------------------------------------

by vicb at 2012-02-20T18:03:19Z

@schmittjoh thank you for your feedback.

message-2:

* I think the first case is fine (children "1" to "5"). Sometimes you just don't care about the names so it should not be forbidden.
* I also think the second case is fine as you would write `foo: value` in your config file anyway.

Let me know your thoughts about the previous statements.

Agree to change when to if.

message-1:

Will change

---------------------------------------------------------------------------

by vicb at 2012-02-20T18:06:33Z

I think "IfNoneSet" is more accurate than "IfNotSet" ?

---------------------------------------------------------------------------

by schmittjoh at 2012-02-20T18:09:59Z

If you call "useAttributeAsKey" it automatically means that the keys are meaningful to you (otherwise there is no point in calling it). In such a case, keys should be explicitly given.

On the other hand, if you do not call it, then the keys are ignored/dropped by the Config component. So if you give a key, it is an obvious error that we should catch. The second case I linked would look like ``foo: [value]`` in contrast to ``foo: { foo: value }``.

---------------------------------------------------------------------------

by schmittjoh at 2012-02-20T18:14:44Z

I'm not feeling strongly about this, but "IfNotSet" is more consistent with
"addDefaultsIfNotSet" and basically reads as "if array node is not set, do
...". Your example would refer to the children and read as "if none
(children) have been defined, do ...".

On Mon, Feb 20, 2012 at 12:06 PM, Victor Berchet <
reply@reply.github.com
> wrote:

> I think "IfNoneSet" is more accurate than "IfNotSet" ?
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/3403#issuecomment-4058579
>

---------------------------------------------------------------------------

by vicb at 2012-02-20T18:30:21Z

message-2:

* Agree on first point, will change
* You could specify the keys in your config file if the prototype is an array (you used a scalar). Should we implement a switch in the validation (i.e. array / not array) or just go with numeric / null arg  as you suggest ?

message-1:

> Your example would refer to the children and read as "if none (children) have been defined, do ..."

QED

---------------------------------------------------------------------------

by vicb at 2012-02-20T22:11:05Z

@schmittjoh I have implemented your suggestions (other than the "NoneSet"). Let me know if you think this is ok. Thanks.

---------------------------------------------------------------------------

by schmittjoh at 2012-02-21T03:24:19Z

Looks good to me.

As an additional improvement we might consider to allow to prepopulate an prototyped with values. For example, in the FOSRestBundle there is a case where this could be used.

```php
->arrayNode('formats')
    ->prepopulateValues(array('application/json' => 'json', 'application/xhtml+xml' => 'xml'))
    ->useAttributeAsKey('name')
    ->prototype('scalar')->canBeUnset()->end()
```

This could be done in a separate PR however and is not strictly related to these improvements.

---------------------------------------------------------------------------

by vicb at 2012-02-21T07:51:59Z

@schmittjoh that would be a great addition but I think need some thinking (i.e. the name, `initialValues` ?, should we handle duplicates, how - in case we are not using attribue as key, ...) so let's make an other PR, I'd like this one to be merged asap as I need this for the Cache Bundle.

@fabpot ready
2012-02-22 16:32:31 +01:00
stealth35 bffbb5e324 typo 2012-02-22 16:28:56 +01:00
stealth35 b82862aef5 [Translation] Add IcuResFileDumper 2012-02-22 16:15:11 +01:00
stealth35 8e569dd976 [Translation] ResourceBundleLoader to IcuRes/DatFileLoader 2012-02-22 16:14:47 +01:00