[Form] Added all() method to the FormBuilder class

In order to perform some introspection on a FormBuilder instance,
we need to be able to get its children. Almost everything is accessible
in this class, but the children are not.

This PR adds a all() method to respect the current API (get(), remove(),
...).
[Form] [Tests] Used assertCount()
[Routing] small refactoring + language fixes
HttpKernel test fix on windows
merged branch willdurand/add-all-method-to-form-builder (PR #3886)

Commits
-------

be2456b [Form] [Tests] Used assertCount()
4120f13 [Form] Added all() method to the FormBuilder class

Discussion
----------

[Form] Added all() method to the FormBuilder class

In order to perform some introspection on a FormBuilder instance,
we need to be able to get its children. Almost everything is accessible
in this class, but the children are not.

This PR adds a all() method to respect the current API (get(), remove(),
...).

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

by bschussek at 2012-04-12T09:54:04Z

:+1:
merged branch Tobion/route-compiler (PR #3891)

Commits
-------

cb47b03 [Routing] small refactoring + language fixes

Discussion
----------

[Routing] small refactoring + language fixes

tests pass, no bc break

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

by vicb at 2012-04-12T06:42:19Z

@Tobion could you squash your commits ?

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

by Tobion at 2012-04-12T19:25:03Z

done
[FrameworkBundle] made the Esi and Store instances configurable in HttpCache base class
[HttpKernel] Allow override of ContainerBuilder instance used to build container
merged branch drak/kernel_dicb (PR #3909)

Commits
-------

82bbf3b [HttpKernel] Allow override of ContainerBuilder instance used to build container

Discussion
----------

[HttpKernel] Allow override of ContainerBuilder class in Kernel

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

The ContainerBuilder class is hard coded into the `buildContainer()` method and is therefor not extensible.

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

by fabpot at 2012-04-13T04:54:28Z

I would definitely prefer a `getContainerBuilder()` that returns a container builder. But why would you want to do that?

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

by drak at 2012-04-13T05:12:13Z

@fabpot - The use case is to override the behaviour of the compilation that is performed by the kernel on the container.  There is no way to override the compile() method called on the builder because the class is created hard in `Kernel::buildContainer()`. This was the simplest way to change it without other cascading changes.

If we had a method which returned a container builder instance, would it just be something that creates a container builder, or acts as a getter on a property? The reason I ask is there is no real need to have a container builder persisting in a property, so a method that just returns a `new ContainerBuilder()` would also work but then we have to deal with the constructor as there is no way to set a ParameterBag on a container and `Kernel::buildContainer()` needs that.

Basically, my reasoning is that since this particular container is just a throwaway, it seems ok to control the class name that was used to create the throwaway builder.

So are you suggesting doing this instead?

    protected function getContainerBuilder()
    {
        return new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
    }

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

by fabpot at 2012-04-13T05:22:20Z

Yes this was my suggestion. But are you sure you cannot solve your problems with compiler passes?

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

by drak at 2012-04-13T05:38:29Z

@fabpot, yes, this particular issue can't be solved by compiler passes.  I'll adapt the PR.

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

by drak at 2012-04-13T05:46:03Z

@fabpot, amended as per your suggestion.
[FrameworkBundle] fixed name collision
[FrameworkBundle] Make session save path configurable
merged branch Tobion/httpkernel-test (PR #3906)

Commits
-------

c331f4a HttpKernel test fix on windows

Discussion
----------

HttpKernel test fix on windows

The changes in `StopwatchEventTest` are only for consistency with the other tests in this file.

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

by drak at 2012-04-13T04:16:19Z

@fabpot - This seems to be an eternal problem with the these particular tests. I wonder if there is a better way to do this.  How about a simple greater than condition to show time has elapsed?

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

by Tobion at 2012-04-13T04:33:04Z

The tests are fine. I didn't change them. Just made it more consistent.

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

by drak at 2012-04-13T04:49:20Z

Yes, but if you look at the history of these tests files, they are constantly being tweaked for whatever reason (and they often fail on windows builds randomly). This is a clear indication the tests are not robust and a different approach is probably warranted if it can be found.

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

by drak at 2012-04-13T04:52:53Z

@Tobion - regarding the commit message, what does "fix" refer to if the tests are fine?

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

by Tobion at 2012-04-13T04:56:39Z

The test in `KernelTest` did not pass for me. That's fixed.
merged branch asm89/configurable-session-save-path (PR #3912)

Commits
-------

c0e7ee9 [FrameworkBundle] Make session save path configurable

Discussion
----------

[FrameworkBundle] Make session save path configurable

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/asm89/symfony.png?branch=configurable-session-save-path)](http://travis-ci.org/asm89/symfony)

Makes it possible to configure the session save path. It still defaults to saving sessions in the kernel cache dir. This might not be appropriate if you want to keep your user sessions after deploying your application.

As promised to @fabpot I will also do a PR on the docs explaining why this might be useful.

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

by drak at 2012-04-13T10:16:17Z

It might be good to default this value to `%kernel.cache_dir%/sessions`.

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

by stloyd at 2012-04-13T10:30:58Z

@drak https://github.com/symfony/symfony/pull/3912/files#L0R184

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

by drak at 2012-04-13T10:31:57Z

@stloyd need my eyes checked :-P
[Form] Deprecated FormValidatorInterface and moved implementations to event listeners
merged branch bschussek/remove-form-validator (PR #3797)

Commits
-------

6df7a72 [Form] Deprecated FormValidatorInterface and moved implementations to event listeners

Discussion
----------

[Form] Removed FormValidatorInterface and notion of form validators

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

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=remove-form-validator)

This cleanup has been lying on a disk for a while, so here it goes.

The FormValidatorInterface has been removed in order to reduce the complexity of the Form API. The same expressivity can be achieved by using POST_BIND event listeners. The POST_VALIDATE event introduced in e6577debf6892afeb2d10eb8a3a0fae0d55c9545 can be replaced by a POST_BIND listener with low priority.

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

by bschussek at 2012-04-11T15:19:24Z

Rebased on master.

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

by bschussek at 2012-04-12T12:46:14Z

@fabpot Can this be merged?
Fix issue #3251: Check attribute type of service tags

The attributes of service tags have to be of a scalar type.
It was possible to add arrays here with yaml-configuration.
merged branch phreaknerd/fix_issue_#3251_for_2.0 (PR #3926)

Commits
-------

3ae826a Fix issue #3251: Check attribute type of service tags

Discussion
----------

Fix issue #3251: Check attribute type of service tags

The attributes of service tags have to be of a scalar type.
It was possible to add arrays here with yaml-configuration.
[Profiler] Minimize the number of Profile writes

squash

squash
[Profiler] Sub requests are not Main requests
merged branch vicb/profiler/listener (PR #3920)

Commits
-------

b611db8 [Profiler] Sub requests are not Main requests
2551270 [Profiler] Minimize the number of Profile writes

Discussion
----------

[HttpKernel] Profiler Listener tweaks

* `setParent()` is called in [`Profile::addChild()`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Profiler/Profile.php#L180) in 2.1
* The profiles are now only saved once only in the listener (either at the end of the main request or on an exception)
* The profiles are now only saved once only in the TraceableEventDispatcher (twice for the root profile when there is a kernel.terminate' event

[![Build Status](https://secure.travis-ci.org/vicb/symfony.png?branch=profiler/listener)](http://travis-ci.org/vicb/symfony)

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

by vicb at 2012-04-13T11:15:25Z

Not so sure for the save part... I'll double check