8000 [HttpFoundation] Simplify session storage class names now we have a s… · symfony/symfony@5b7ef11 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 5b7ef11

Browse files
author
Drak
committed
[HttpFoundation] Simplify session storage class names now we have a separate namespace for sessions.
1 parent 27530cb commit 5b7ef11

35 files changed

+131
-127
lines changed

CHANGELOG-2.1.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
230230
* added ResponseHeaderBag::makeDisposition() (implements RFC 6266)
231231
* made mimetype to extension conversion configurable
232232
* [BC BREAK] Moved all session related classes and interfaces into own namespace, as
233-
`Symfony\Component\HttpFoudation\Session`.
233+
`Symfony\Component\HttpFoudation\Session` and renamed classes accordingly.
234234
* Flashes are now stored as a bucket of messages per `$type` so there can be multiple messages per type.
235235
There are four interface constants for type, `FlashBagInterface::INFO`, `FlashBagInterface::NOTICE`,
236236
`FlashBagInterface::WARNING` and `FlashBagInterface::ERROR`.
@@ -242,19 +242,23 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
242242
` 8912 getFlash()`, `hasFlash()`, andd `removeFlash()`. `getFlashes() returns a `FlashBagInterface`.
243243
* `Session->clear()` now only clears session attributes as before it cleared flash messages and
244244
attributes. `Session->getFlashes()->popAll()` clears flashes now.
245-
* Added `AbstractSessionStorage` base class for session storage drivers.
246-
* Added `SessionSaveHandler` interface which storage drivers should implement after inheriting from
247-
`AbstractSessionStorage` when writing custom session save handlers.
248-
* [BC BREAK] `SessionStorageInterface` methods removed: `write()`, `read()` and `remove()`. Added
249-
`getAttributes()`, `getFlashes()`.
250-
* Moved attribute storage to `AttributeBagInterface`.
251-
* Added `AttributeBag` to replicate attributes storage behaviour from 2.0.x (default).
252-
* Added `NamespacedAttributeBag` for namespace session attributes.
253-
* Session now implements `SessionInterface` making implementation customizable and portable.
254-
* [BC BREAK] Removed `NativeSessionStorage` and replaced with `NativeFileSessionStorage`.
245+
* Added `Symfony\Component\HttpFoundation\Session\Storage\AbstractStorage` base class for
246+
session storage drivers.
247+
* Added `Symfony\Component\HttpFoundation\Session\Storage\SaveHandlerInterface` interface
248+
which storage drivers should implement after inheriting from
249+
`Symfony\Component\HttpFoundation\Session\Storage\AbstractStorage` when writing custom session save handlers.
250+
* [BC BREAK] `StorageInterface` methods removed: `write()`, `read()` and `remove()`. Added
251+
`getBag()`, `registerBag()`.
252+
* Moved attribute storage to `Symfony\Component\HttpFoundation\Attribute\AttributeBagInterface`.
253+
* Added `Symfony\Component\HttpFoundation\Attribute\AttributeBag` to replicate attributes storage
254+
behaviour from 2.0.x (default).
255+
* Added `Symfony\Component\HttpFoundation\Attribute\NamespacedAttributeBag` for namespace session attributes.
256+
* Session now implements `Symfony\Component\HttpFoundation\Session\SessionInterface` making
257+
implementation customizable and portable.
258+
* [BC BREAK] Removed `NativeStorage` and replaced with `NativeFileStorage`.
255259
* Added session storage drivers for PHP native Memcache, Memcached and SQLite session save handlers.
256260
* Added session storage drivers for custom Memcache, Memcached and Null session save handlers.
257-
* Removed `FilesystemSessionStorage`, use `MockFileSessionStorage` for functional testing instead.
261+
* Removed `FilesystemStorage`, use `MockFileStorage` for functional testing instead.
258262

259263
### HttpKernel
260264

UPGRADE-2.1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ UPGRADE FROM 2.0 to 2.1
313313
* Session storage drivers
314314

315315
Session storage drivers should inherit from
316-
`Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage`
316+
`Symfony\Component\HttpFoundation\Session\Storage\AbstractStorage`
317317
and no longer should implement `read()`, `write()`, `remove()` which were removed from the
318-
`SessionStorageInterface`.
318+
`StorageInterface`.
319319

320320
Any session storage driver that wants to use custom save handlers should
321321
implement `Symfony\Component\HttpFoundation\Session\Storage\SessionSaveHandlerInterface`

src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionStorage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Symfony\Bridge\Doctrine\HttpFoundation;
44

55
use Doctrine\DBAL\Platforms\MySqlPlatform;
6-
use Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage;
6+
use Symfony\Component\HttpFoundation\Session\Storage\AbstractStorage;
77
use Symfony\Component\HttpFoundation\Session\Storage\SessionSaveHandlerInterface;
88
use Doctrine\DBAL\Driver\Connection;
99

@@ -13,7 +13,7 @@
1313
* @author Fabien Potencier <fabien@symfony.com>
1414
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
1515
*/
16-
class DbalSessionStorage extends AbstractSessionStorage implements SessionSaveHandlerInterface
16+
class DbalStorage extends AbstractStorage implements SessionSaveHandlerInterface
1717
{
1818
/**
1919
* @var Connection

src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionStorageSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
1111
*/
12-
final class DbalSessionStorageSchema extends Schema
12+
final class DbalStorageSchema extends Schema
1313
{
1414
private $tableName;
1515

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
301301

302302
$this->addClassesToCompile(array(
303303
'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener',
304-
'Symfony\\Component\\HttpFoundation\\Session\Storage\\SessionStorageInterface',
304+
'Symfony\\Component\\HttpFoundation\\Session\Storage\\StorageInterface',
305305
$container->getDefinition('session')->getClass(),
306306
));
307307

src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
<parameter key="session.class">Symfony\Component\HttpFoundation\Session\Session</parameter>
99
<parameter key="session.flashbag.class">Symfony\Component\HttpFoundation\Session\Flash\FlashBag</parameter>
1010
<parameter key="session.attribute_bag.class">Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag</parameter>
11-
<parameter key="session.storage.native_file.class">Symfony\Component\HttpFoundation\Session\Storage\NativeFileSessionStorage</parameter>
12-
<parameter key="session.storage.null.class">Symfony\Component\HttpFoundation\Session\Storage\NullSessionStorage</parameter>
13-
<parameter key="session.storage.native_memcache.class">Symfony\Component\HttpFoundation\Session\Storage\NativeMemcacheSessionStorage</parameter>
14-
<parameter key="session.storage.native_memcached.class">Symfony\Component\HttpFoundation\Session\Storage\NativeMemcachedSessionStorage</parameter>
15-
<parameter key="session.storage.native_sqlite.class">Symfony\Component\HttpFoundation\Session\Storage\NativeSqliteSessionStorage</parameter>
16-
<parameter key="session.storage.memcache.class">Symfony\Component\HttpFoundation\Session\Storage\MemcacheSessionStorage</parameter>
17-
<parameter key="session.storage.memcached.class">Symfony\Component\HttpFoundation\Session\Storage\MemcachedSessionStorage</parameter>
18-
<parameter key="session.storage.mock_file.class">Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage</parameter>
11+
<parameter key="session.storage.native_file.class">Symfony\Component\HttpFoundation\Session\Storage\NativeFileStorage</parameter>
12+
<parameter key="session.storage.null.class">Symfony\Component\HttpFoundation\Session\Storage\NullStorage</parameter>
13+
<parameter key="session.storage.native_memcache.class">Symfony\Component\HttpFoundation\Session\Storage\NativeMemcacheStorage</parameter>
14+
<parameter key="session.storage.native_memcached.class">Symfony\Component\HttpFoundation\Session\Storage\NativeMemcachedStorage</parameter>
15+
<parameter key="session.storage.native_sqlite.class">Symfony\Component\HttpFoundation\Session\Storage\NativeSqliteStorage</parameter>
16+
<parameter key="session.storage.memcache.class">Symfony\Component\HttpFoundation\Session\Storage\MemcacheStorage</parameter>
17+
<parameter key="session.storage.memcached.class">Symfony\Component\HttpFoundation\Session\Storage\MemcachedStorage</parameter>
18+
<parameter key="session.storage.mock_file.class">Symfony\Component\HttpFoundation\Session\Storage\MockFileStorage</parameter>
1919
<parameter key="session.memcache.class">Memcache</parameter>
2020
<parameter key="session.memcached.class">Memcached</parameter>
2121

src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpFoundation\Session\Session;
16-
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
16+
use Symfony\Component\HttpFoundation\Session\Storage\MockArrayStorage;
1717
use Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper;
1818
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
1919
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
@@ -26,7 +26,7 @@ public function setUp()
2626
{
2727
$this->request = new Request();
2828

29-
$session = new Session(new MockArraySessionStorage());
29+
$session = new Session(new MockArrayStorage());
3030
$session->set('foobar', 'bar');
3131
$session->getFlashes()->set(FlashBag::NOTICE, 'bar');
3232

src/Symfony/Bundle/FrameworkBundle/Tests/Templating/PhpEngineTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\DependencyInjection\Container;
1616
use Symfony\Component\HttpFoundation\Request;
1717
use Symfony\Component\HttpFoundation\Session\Session;
18-
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
18+
use Symfony\Component\HttpFoundation\Session\Storage\MockArrayStorage;
1919
use Symfony\Component\Templating\TemplateNameParser;
2020
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables;
2121
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
@@ -64,7 +64,7 @@ protected function getContainer()
6464
{
6565
$container = new Container();
6666
$request = new Request();
67-
$session = new Session(new MockArraySessionStorage());
67+
$session = new Session(new MockArrayStorage());
6868

6969
$request->setSession($session);
7070
$container->set('request', $request);

src/Symfony/Bundle/TwigBundle/Tests/TwigEngineTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\DependencyInjection\Container;
1616
use Symfony\Component\HttpFoundation\Request;
1717
use Symfony\Component\HttpFoundation\Session\Session;
18-
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
18+
use Symfony\Component\HttpFoundation\Session\Storage\MockArrayStorage;
1919
use Symfony\Component\Templating\TemplateNameParser;
2020
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables;
2121

@@ -71,7 +71,7 @@ protected function getContainer()
7171
{
7272
$container = new Container();
7373
$request = new Request();
74-
$session = new Session(new MockArraySessionStorage());
74+
$session = new Session(new MockArrayStorage());
7575

7676
$request->setSession($session);
7777
$container->set('request', $request);

src/Symfony/Component/DependencyInjection/Container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
*
4444
* <ul>
4545
* <li>request -> getRequestService()</li>
46-
* <li>mysql_session_storage -> getMysqlSessionStorageService()</li>
47-
* <li>symfony.mysql_session_storage -> getSymfony_MysqlSessionStorageService()</li>
46+
* <li>mysql_session_storage -> getMysqlStorageService()</li>
47+
* <li>symfony.mysql_session_storage -> getSymfony_MysqlStorageService()</li>
4848
* </ul>
4949
*
5050
* The container can have three possible behaviors when a service does not exist:

0 commit comments

Comments
 (0)
0