merged branch drak/flashbag_default (PR #4926)

Commits
-------

5ae0da0 Update changelogs
ff91b9a [FrameworkBundle] Make FlashBag the default.

Discussion
----------

[2.1][FrameworkBundle] Make FlashBag the default.

Bug fix: no
Feature addition: yes
Backwards compatibility break: yes (but only technically)
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT

The difference between `AutoExpireFlashBag` and `FlashBag` is simply that the first will expire flashes regardless of being displayed on the next pageload.  This can result in lost messages. It was created simply for BC with 2.0.

`FlashBag` expires flashes once they are retrieved. This also makes it ESI compatible.

/cc @lsmith77

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

by jalliot at 2012-07-14T18:13:40Z

+1!
You should add it to the changelog and upgrade files though :)
This commit is contained in:
Fabien Potencier 2012-07-15 09:23:39 +02:00
commit cf146c0c01
3 changed files with 7 additions and 4 deletions

View File

@ -36,5 +36,8 @@ CHANGELOG
start on demand.
* [BC BREAK] TemplateNameParser::parseFromFilename() has been moved to a dedicated
parser: TemplateFilenameParser::parse().
* [BC BREAK] Kernel parameters are replaced by their value whereever they appear
* [BC BREAK] Kernel parameters are replaced by their value wherever they appear
in Route patterns, requirements and defaults. Use '%%' as the escaped value for '%'.
* [BC BREAK] Switched behavior of flash messages to expire flash messages on retrieval
using Symfony\Component\HttpFoundation\Session\Flash\FlashBag as opposed to on
next pageload regardless of whether they are displayed or not.

View File

@ -6,7 +6,7 @@
<parameters>
<parameter key="session.class">Symfony\Component\HttpFoundation\Session\Session</parameter>
<parameter key="session.flashbag.class">Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag</parameter>
<parameter key="session.flashbag.class">Symfony\Component\HttpFoundation\Session\Flash\FlashBag</parameter>
<parameter key="session.attribute_bag.class">Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag</parameter>
<parameter key="session.storage.native.class">Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage</parameter>
<parameter key="session.storage.mock_file.class">Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage</parameter>

View File

@ -54,8 +54,8 @@ CHANGELOG
* Added `FlashBag`. Flashes expire when retrieved by `get()` or `all()`. This
implementation is ESI compatible.
* Added `AutoExpireFlashBag` (default) to replicate Symfony 2.0.x auto expire
behaviour of messages auto expiring.
after one page page load. Messages must be retrieved by `get()` or `all()`.
behaviour of messages auto expiring after one page page load. Messages must
be retrieved by `get()` or `all()`.
* Added `Symfony\Component\HttpFoundation\Attribute\AttributeBag` to replicate
attributes storage behaviour from 2.0.x (default).
* Added `Symfony\Component\HttpFoundation\Attribute\NamespacedAttributeBag` for