[HttpFoundation] Documentation.

Added blocks, updated links and references and fixed typos.
Note it is not possible to throw exceptions in the write or close methods of a session save handler.
Added a 'post validation' event to the form component.
merged branch drak/session_docblocks (PR #3413)

Commits
-------

09be5cb [HttpFoundation] Documentation.
7f8c293 [HttpFoudation] Add ability to configure sqlite session storage.

Discussion
----------

[HttpFoundation] Session docblocks

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

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

by drak at 2012-02-22T18:19:45Z

Please note the documentation referred to will be published a php.net this Friday (docs are built weekly).

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

by drak at 2012-02-24T11:16:57Z

@fabpot - this is ready for merge.

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

by fabpot at 2012-03-01T00:02:09Z

Can you squash your commits before I merge? Thanks.

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

by drak at 2012-03-01T00:57:50Z

Done.
merged branch mvrhov/session_cookie_merge (PR #3423)

Commits
-------

471b564 auto_start should be false
6e2a7da Support session cookie options with cookie_ prefix
e0fba80 Properly merge session cookie_* parameters

Discussion
----------

Set session.cookie_* parameters properly

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

Cookie parameters in $options are not prefixed with cookie_ the same is true for data returned from session_get_cookie_params.

I've marked this as BC because the options that get dumped into the container have different name. But I don't think anybody was actually changing them or accessing them in their bundles.

P.S. @drak also desires some credits for this PR as I incorporated some lines written by him in one of the iterations.

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

by drak at 2012-02-23T14:24:42Z

@mvrhov - what does this fix exactly? It looks like a different way of doing the same thing but now there is no default value on `cookie_httponly`.

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

by mvrhov at 2012-02-23T15:09:17Z

Like I said in description. $option contains some cookie options and none of them has cookie_ prefix.
And this prefix is needed in two cases:
- to properly merge defaults and override them with what user set
- in a foreach for for proper ini_set

Sorry non native speaker an a bit hard to explain, could you ping me in a couple of hours on IRC if this still doesn't make any sense.

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

by drak at 2012-02-23T15:29:41Z

@mvrhov - I wrote some tests for this particular code and I still don't see what this PR fixes. I'll try to catch you on IRC later on but can't guarantee it.

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

by mvrhov at 2012-02-23T16:02:41Z

added test

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

by drak at 2012-02-24T08:30:51Z

Just for reference for those reading this ticket, `session_set_cookie_params()` alters the runtime ini settings it corresponds to see http://docs.php.net/manual/en/function.session-set-cookie-params.php so we agreed to remove the special handling that was present since it is redundant.

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

by dlsniper at 2012-02-28T22:19:32Z

Hi, Is this patch relevant or not after all?
ping @drak @mvrhov

Thanks :)

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

by drak at 2012-02-29T03:34:22Z

It is relevant.  Maybe I'll do the cleanup this PR by forking it if @mvrhov doesn't have time.

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

by mvrhov at 2012-02-29T05:40:47Z

Fixed the typo and changed the false to ture as reported in comments. I've also rebased. I'll see what I can do about config file change later today. Sorry for the delay, been too busy for the past week.

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

by mvrhov at 2012-02-29T08:49:23Z

I've also done the config part.

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

by mvrhov at 2012-02-29T11:01:14Z

Ok, this should be it.

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

by drak at 2012-03-01T00:59:16Z

@fabpot - looks good from my side.
[WebProfilerBundle] Router panel: take the request method into account
[Routing] Fixed Router::match documentation
[Routing] Updated Router::match and Router::generate documentation
Updating use of DoctrineBundle Registry to use the proper path to Doctrine\Bundle\DoctrineBundle\Registry
Reverting return type left by mistake
[Process] PHP_BINARY return the current process
Only work with the cli sapi
merged branch stealth35/patch-16 (PR #3487)

Commits
-------

caa44ae Only work with the cli sapi
e2fc3cd [Process] PHP_BINARY return the current process

Discussion
----------

[Process] PHP_BINARY only return the current sapi process

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

PHP_BINARY return the current process, so under the apache module I get (on Windows) `httpd.exe`

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

by vicb at 2012-03-02T14:48:04Z

Could it be '.../php5' ?
Is it a PHP bug ?

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

by stealth35 at 2012-03-02T15:00:57Z

@vicb

> Could it be '.../php5' ?

Yes, but it's not the standard installation, you also call you php executable 'blabla.exe'

> Is it a PHP bug ?

I'don't now, I think it's get the SAPI but If it's work under Unix so yes it's a PHP Bug
http://lxr.php.net/opengrok/xref/PHP_5_4/main/main.c#binary_location

I'll test this on my Mac

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

by vicb at 2012-03-02T15:08:25Z

@stealth35

* asking about 'php5' because it seems some systems use this name,
* would testing for a cli sapi be more robust than making assumptions about the process name ?

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

by stealth35 at 2012-03-02T15:24:24Z

@vicb yes I think it's better

Anybody can test `PHP_BINARY` with some sapi like : `cgi`, `cgi-fcgi`, `fpm-fcgi` ... ?
merged branch vicb/patch-1 (PR #3481)

Commits
-------

5886c55 [WebProfilerBundle] Router panel: take the request method into account

Discussion
----------

[WebProfilerBundle] Router panel: take the request method into account

Before this change we were always using the default method (i.e. 'GET').
[FrameworkBundle] fix DependencyInjection/*FrameworkExtensionTest for Windows
merged branch stealth35/patch-17 (PR #3491)

Commits
-------

8fa2ff0 [FrameworkBundle] fix DependencyInjection/*FrameworkExtensionTest for Windows

Discussion
----------

[FrameworkBundle] fix DependencyInjection/*FrameworkExtensionTest for Windows
merged branch blogsh/router-patch-1 (PR #3483)

Commits
-------

ba251d8 [Routing] Updated Router::match and Router::generate documentation
2ce15bd [Routing] Fixed Router::match documentation

Discussion
----------

[Routing] Fixed Router::match and Router::generate documentation

Documentation of Router::match has been deprecated/invalid.

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

by stof at 2012-03-01T17:41:41Z

even better way to fix this: replace it with ``{@inheritdoc}``

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

by blogsh at 2012-03-01T19:22:06Z

Okay, wasn't sure whether this is appreciated because it inherits the method over 3 corners :)
merged branch snc/profiler-tests (PR #3454)

Commits
-------

ed8c1c0 Fixed AbstractProfilerStorageTest and some minor CS changes.
1ac581e Overwrite the profile data if the token already exists like in the other implementations.
198d406 Return profiler results sorted by time in descending order like in the other implementations.
9d8e3f2 Refactored profiler storage tests to share some code.

Discussion
----------

[WIP] Refactored profiler tests including some storage fixes

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

While refactoring the tests I came across some inconsistencies. Two of them are already fixed in this PR.

One thing left is the [MongoDbProfilerStorageTest::testCleanup()](https://github.com/snc/symfony/blob/9d8e3f2da4bea58316e32ef41d4e856a0cfdc872/tests/Symfony/Tests/Component/HttpKernel/Profiler/MongoDbProfilerStorageTest.php#L51) test which fails in all other storage implementations. The mongodb implementation uses the `time` value from the profiler data to clean up the storage while the others additionally save a `created_at` value which is then used. For me this `created_at` value does not make any sense and I would suggest to change the other implementations to use the `time` value for cleaning up. What do you think?

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

by pulzarraider at 2012-02-27T06:55:06Z

+1 for refactoring profiler tests, I will update my RedisProfilerStorage after your changes will be merged.

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

by snc at 2012-02-28T20:05:12Z

Any suggestions about the cleanup issue?
merged branch jmikola/patch-3 (PR #3450)

Commits
-------

265360d [DoctrineBridge] Simpler result checking in UniqueEntityValidator

Discussion
----------

[DoctrineBridge] Simpler result checking in UniqueEntityValidator

In 928e352d09a6bb0b566e61bc7482ead1d4859442, support for MongoDB cursors was implemented by converting an Iterable, non-ArrayAccess object to an array. The ArrayAccess check didn't seem purposeful, since cursors are only Iterable and ORM returns real arrays. Since we only need to access the first element of the cursor (and only in cases where the count is exactly 1), we can simply use current() to handle Iterables and arrays.

@henrikbjorn: Any thoughts on this? I was testing @stof's work in doctrine/DoctrineMongoDBBundle#68 and our Symfony submodule was a bit old, so I fixed UniqueEntityValidator on my local machine before I realized you had come up with a solution a few weeks ago.
merged branch jonathaningram/patch-6 (PR #3422)

Commits
-------

88ccb9b Added another corner case
7c4343f Added 4 assertions related to simple URLs containing ? and #

Discussion
----------

[Validator] added assertions related to simple URLs containing ? and #

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

This adds 5 assertions for corner cases when validating a URL containing `?` and/or `#`.

Note: this does not actually fix any bugs, it just adds a few more cases.

I hope I've sent this to the correct branch - it's not a bug fix so I've not sent it to 2.0.x, but it's not a feature either...
merged branch Toflar/patch-1 (PR #3408)

Commits
-------

4f8e8ef Improving performance on digit filtering

Discussion
----------

Improving performance on digit filtering

I haven't tested it on a productive system but I think it should be way faster to use filter_var() instead of preg_replace() for several reasons.

This is my first pull request for symfony and I don't know how you do those kind of performance tests but please verify my assumption if you can :-)

Maybe we can also use filter_var() to replace other regular expressions :-)

HTH =)

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

by drak at 2012-02-22T00:35:44Z

@Toflar - nice move +1

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

by drak at 2012-02-22T18:53:40Z

@Toflar - Maybe you can bench the changes using this as a template: https://gist.github.com/1356129

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

by Toflar at 2012-02-23T13:18:18Z

I have already. And it's way faster, otherwise I wouldn't have opened a pull request ;) But obviously it strongly depends on the length of the string and the environment. That's why I was wondering whether you have a general performance tests environment ;) Because the results strongly depend on other factors, there's - in my opinion - no point in exact results. If a general info is sufficient: my tests for the regex resulted in about 7 - 8 microseconds whereas the filter version only took 1.5 - 2 microseconds for the same string.