From 282d3ae1d8a7fb73e65553b0c016f4c1369e34bf Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 11 Feb 2012 12:44:56 +0100 Subject: [PATCH] updated CHANGELOG for 2.1 --- CHANGELOG-2.1.md | 16 +++---- UPGRADE-2.1.md | 43 +++++++++---------- .../HttpFoundation/Session/Session.php | 4 ++ 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/CHANGELOG-2.1.md b/CHANGELOG-2.1.md index 005ff15227..4b69f6a794 100644 --- a/CHANGELOG-2.1.md +++ b/CHANGELOG-2.1.md @@ -40,10 +40,6 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c * changed the default profiler storage to use the filesystem instead of SQLite * added support for placeholders in route defaults and requirements (replaced by the value set in the service container) * added Filesystem component as a dependency - * added new session storage drivers to session.xml: `session.storage.native_memcache`, `session.storage.native_memcached`, - `session.storage.native_sqlite`, `session.storage.null`, `session.storage.memcache`, - and `session.storage.memcached`. Added `session.storage.mock_file` service for functional session testing. - * removed `session.storage.filesystem` service. ### MonologBundle @@ -230,20 +226,20 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c * made mimetype to extension conversion configurable * [BC BREAK] Moved all session related classes and interfaces into own namespace, as `Symfony\Component\HttpFoudation\Session` and renamed classes accordingly. - * Added `FlashBag` (default). Flashes expire when retrieved by `get()` or `all()`. + * Added `FlashBag`. Flashes expire when retrieved by `get()` or `all()`. This makes the implementation ESI compatible. - * Added `AutoExpireFlashBag` to replicate Symfony 2.0.x auto expire behaviour of messages auto expiring + * Added `AutoExpireFlashBag` (default) to replicate Symfony 2.0.x auto expire behaviour of messages auto expiring after one page page load. Messages must be retrived by `get()` or `all()`. - * [BC BREAK] Removed the following methods from the Session class: `close()`, `setFlash()`, `setFlashes()` - `getFlash()`, `hasFlash()`, andd `removeFlash()`. `getFlashes() returns a `FlashBagInterface`. + * Deprecated the following methods from the Session class: `close()`, `setFlash()`, `setFlashes()` + `getFlash()`, `hasFlash()`, and `removeFlash()`. Use `getFlashes() instead which returns a `FlashBagInterface`. * `Session->clear()` now only clears session attributes as before it cleared flash messages and attributes. `Session->getFlashes()->all()` clears flashes now. * Added `Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage` base class for session storage drivers. - * Added `Symfony\Component\HttpFoundation\Session\Storage\SaveHandlerInterface` interface + * Added `Symfony\Component\HttpFoundation\Session\Storage\SessionSaveHandlerInterface` interface which storage drivers should implement after inheriting from `Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage` when writing custom session save handlers. - * [BC BREAK] `StorageInterface` methods removed: `write()`, `read()` and `remove()`. Added + * [BC BREAK] `SessionStorageInterface` methods removed: `write()`, `read()` and `remove()`. Added `getBag()`, `registerBag()`. * Moved attribute storage to `Symfony\Component\HttpFoundation\Attribute\AttributeBagInterface`. * Added `Symfony\Component\HttpFoundation\Attribute\AttributeBag` to replicate attributes storage diff --git a/UPGRADE-2.1.md b/UPGRADE-2.1.md index 2df9529737..316efdff81 100644 --- a/UPGRADE-2.1.md +++ b/UPGRADE-2.1.md @@ -80,8 +80,8 @@ UPGRADE FROM 2.0 to 2.1 explicitely need to set the `Valid` constraint in your model if you want to validate associated objects. - If you don't want to set the `Valid` constraint, or if there is no reference - from the data of the parent form to the data of the child form, you can + If you don't want to set the `Valid` constraint, or if there is no reference + from the data of the parent form to the data of the child form, you can enable BC behaviour by setting the option "cascade_validation" to `true` on the parent form. @@ -236,12 +236,27 @@ UPGRADE FROM 2.0 to 2.1 return false; } } - the parent form. - Before: $session->getLocale() - After: $request->getLocale() +* The options passed to `getParent` of the form types don't contain default + options anymore - * Flash Messages now returns and array based on type + You should check with `isset` if options exist before checking their value. + + Before: + + public function getParent(array $options) + { + return 'single_text' === $options['widget'] ? 'text' : 'choice'; + } + + After: + + public function getParent(array $options) + { + return isset($options['widget']) && 'single_text' === $options['widget'] ? 'text' : 'choice'; + } + +* Flash Messages now returns and array based on type (the old method are still available but deprecated) Before (PHP): @@ -291,13 +306,6 @@ UPGRADE FROM 2.0 to 2.1 {% endforeach %} -* Session object - - The methods, `setFlash()`, `setFlashes()`, `getFlash()`, `hasFlash()`, and `removeFlash()` - have been removed from the `Session` object. `getFlashes()` now returns a `FlashBagInterface`. - Flashes should be popped off the stack using `getFlashes()->get()` or `getFlashes()->all()` - to get all flashes in one go. - * Session storage drivers Session storage drivers should inherit from @@ -307,12 +315,3 @@ UPGRADE FROM 2.0 to 2.1 Any session storage driver that wants to use custom save handlers should implement `Symfony\Component\HttpFoundation\Session\Storage\SaveHandlerInterface` - -### [FrameworkBundle] - - The service `session.storage.native` is now called `session.storage.native_file` - - The service `session.storage.filesystem` is now called `session.storage.mock_file` - and is used for functional unit testing. You will need to update any references - in functional tests. - diff --git a/src/Symfony/Component/HttpFoundation/Session/Session.php b/src/Symfony/Component/HttpFoundation/Session/Session.php index e750a0eb27..8428266278 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session/Session.php @@ -303,4 +303,8 @@ class Session implements SessionInterface { return $this->getBag('flashes')->clear(); } + + public function close() + { + } }