Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

reverted 5b7ef11 (Simplify session

storage class names now we have a separate namespace for sessions)
  • Loading branch information...
commit 74ccf7062a8ca0e6ea3ec664a833c67ab4bed6ea 1 parent 91f4f8a
@fabpot fabpot authored
Showing with 120 additions and 120 deletions.
  1. +4 −4 CHANGELOG-2.1.md
  2. +2 −2 UPGRADE-2.1.md
  3. +3 −3 src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionStorage.php
  4. +1 −1  src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionStorageSchema.php
  5. +1 −1  src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
  6. +8 −8 src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml
  7. +2 −2 src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php
  8. +2 −2 src/Symfony/Bundle/FrameworkBundle/Tests/Templating/PhpEngineTest.php
  9. +2 −2 src/Symfony/Bundle/TwigBundle/Tests/TwigEngineTest.php
  10. +2 −2 src/Symfony/Component/DependencyInjection/Container.php
  11. +8 −8 src/Symfony/Component/HttpFoundation/Session/Session.php
  12. +2 −2 src/Symfony/Component/HttpFoundation/Session/Storage/{AbstractStorage.php → AbstractSessionStorage.php}
  13. +3 −3 src/Symfony/Component/HttpFoundation/Session/Storage/{MemcacheStorage.php → MemcacheSessionStorage.php}
  14. +3 −3 src/Symfony/Component/HttpFoundation/Session/Storage/{MemcachedStorage.php → MemcachedSessionStorage.php}
  15. +3 −3 src/Symfony/Component/HttpFoundation/Session/Storage/{MockArrayStorage.php → MockArraySessionStorage.php}
  16. +3 −3 src/Symfony/Component/HttpFoundation/Session/Storage/{MockFileStorage.php → MockFileSessionStorage.php}
  17. +3 −3 ...ymfony/Component/HttpFoundation/Session/Storage/{NativeFileStorage.php → NativeFileSessionStorage.php}
  18. +3 −3 ...omponent/HttpFoundation/Session/Storage/{NativeMemcacheStorage.php → NativeMemcacheSessionStorage.php}
  19. +3 −3 ...ponent/HttpFoundation/Session/Storage/{NativeMemcachedStorage.php → NativeMemcachedSessionStorage.php}
  20. +3 −3 ...ny/Component/HttpFoundation/Session/Storage/{NativeSqliteStorage.php → NativeSqliteSessionStorage.php}
  21. +2 −2 src/Symfony/Component/HttpFoundation/Session/Storage/{NullStorage.php → NullSessionStorage.php}
  22. +4 −4 src/Symfony/Component/HttpFoundation/Session/Storage/{PdoStorage.php → PdoSessionStorage.php}
  23. +1 −1  .../Component/HttpFoundation/Session/Storage/{SaveHandlerInterface.php → SessionSaveHandlerInterface.php}
  24. +1 −1  src/Symfony/Component/HttpFoundation/Session/Storage/{StorageInterface.php → SessionStorageInterface.php}
  25. +3 −3 tests/Symfony/Tests/Component/HttpFoundation/RequestTest.php
  26. +3 −3 tests/Symfony/Tests/Component/HttpFoundation/Session/SessionTest.php
  27. +11 −11 ...ts/Component/HttpFoundation/Session/Storage/{AbstractStorageTest.php → AbstractSessionStorageTest.php}
  28. +5 −5 .../Component/HttpFoundation/Session/Storage/{MockArrayStorageTest.php → MockArraySessionStorageTest.php}
  29. +5 −5 ...ts/Component/HttpFoundation/Session/Storage/{MockFileStorageTest.php → MockFileSessionStorageTest.php}
  30. +4 −4 ...omponent/HttpFoundation/Session/Storage/{NativeFileStorageTest.php → NativeFileSessionStorageTest.php}
  31. +4 −4 .../HttpFoundation/Session/Storage/{NativeMemcacheStorageTest.php → NativeMemcacheSessionStorageTest.php}
  32. +4 −4 ...ttpFoundation/Session/Storage/{NativeMemcachedStorageTest.php → NativeMemcachedSessionStorageTest.php}
  33. +4 −4 ...nent/HttpFoundation/Session/Storage/{NativeSqliteStorageTest.php → NativeSqliteSessionStorageTest.php}
  34. +6 −6 ...fony/Tests/Component/HttpFoundation/Session/Storage/{NullStorageTest.php → NullSessionStorageTest.php}
  35. +2 −2 tests/Symfony/Tests/Component/Security/Http/Firewall/ContextListenerTest.php
View
8 CHANGELOG-2.1.md
@@ -239,11 +239,11 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
`getFlash()`, `hasFlash()`, andd `removeFlash()`. `getFlashes() 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\AbstractStorage` base class for
+ * Added `Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage` base class for
session storage drivers.
* Added `Symfony\Component\HttpFoundation\Session\Storage\SaveHandlerInterface` interface
which storage drivers should implement after inheriting from
- `Symfony\Component\HttpFoundation\Session\Storage\AbstractStorage` when writing custom session save handlers.
+ `Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage` when writing custom session save handlers.
* [BC BREAK] `StorageInterface` methods removed: `write()`, `read()` and `remove()`. Added
`getBag()`, `registerBag()`.
* Moved attribute storage to `Symfony\Component\HttpFoundation\Attribute\AttributeBagInterface`.
@@ -252,10 +252,10 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
* Added `Symfony\Component\HttpFoundation\Attribute\NamespacedAttributeBag` for namespace session attributes.
* Session now implements `Symfony\Component\HttpFoundation\Session\SessionInterface` making
implementation customizable and portable.
- * [BC BREAK] Removed `NativeStorage` and replaced with `NativeFileStorage`.
+ * [BC BREAK] Removed `NativeSessionStorage` and replaced with `NativeFileSessionStorage`.
* Added session storage drivers for PHP native Memcache, Memcached and SQLite session save handlers.
* Added session storage drivers for custom Memcache, Memcached and Null session save handlers.
- * Removed `FilesystemStorage`, use `MockFileStorage` for functional testing instead.
+ * Removed `FilesystemSessionStorage`, use `MockFileSessionStorage` for functional testing instead.
### HttpKernel
View
4 UPGRADE-2.1.md
@@ -301,9 +301,9 @@ UPGRADE FROM 2.0 to 2.1
* Session storage drivers
Session storage drivers should inherit from
- `Symfony\Component\HttpFoundation\Session\Storage\AbstractStorage`
+ `Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage`
and no longer should implement `read()`, `write()`, `remove()` which were removed from the
- `StorageInterface`.
+ `SessionStorageInterface`.
Any session storage driver that wants to use custom save handlers should
implement `Symfony\Component\HttpFoundation\Session\Storage\SaveHandlerInterface`
View
6 src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionStorage.php
@@ -3,8 +3,8 @@
namespace Symfony\Bridge\Doctrine\HttpFoundation;
use Doctrine\DBAL\Platforms\MySqlPlatform;
-use Symfony\Component\HttpFoundation\Session\Storage\AbstractStorage;
-use Symfony\Component\HttpFoundation\Session\Storage\SaveHandlerInterface;
+use Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\SessionSaveHandlerInterface;
use Doctrine\DBAL\Driver\Connection;
/**
@@ -13,7 +13,7 @@
* @author Fabien Potencier <fabien@symfony.com>
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
-class DbalStorage extends AbstractStorage implements SaveHandlerInterface
+class DbalSessionStorage extends AbstractSessionStorage implements SessionSaveHandlerInterface
{
/**
* @var Connection
View
2  src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionStorageSchema.php
@@ -9,7 +9,7 @@
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
-final class DbalStorageSchema extends Schema
+final class DbalSessionStorageSchema extends Schema
{
private $tableName;
View
2  src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
@@ -301,7 +301,7 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
$this->addClassesToCompile(array(
'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener',
- 'Symfony\\Component\\HttpFoundation\\Session\Storage\\StorageInterface',
+ 'Symfony\\Component\\HttpFoundation\\Session\Storage\\SessionStorageInterface',
$container->getDefinition('session')->getClass(),
));
View
16 src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml
@@ -8,14 +8,14 @@
<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.attribute_bag.class">Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag</parameter>
- <parameter key="session.storage.native_file.class">Symfony\Component\HttpFoundation\Session\Storage\NativeFileStorage</parameter>
- <parameter key="session.storage.null.class">Symfony\Component\HttpFoundation\Session\Storage\NullStorage</parameter>
- <parameter key="session.storage.native_memcache.class">Symfony\Component\HttpFoundation\Session\Storage\NativeMemcacheStorage</parameter>
- <parameter key="session.storage.native_memcached.class">Symfony\Component\HttpFoundation\Session\Storage\NativeMemcachedStorage</parameter>
- <parameter key="session.storage.native_sqlite.class">Symfony\Component\HttpFoundation\Session\Storage\NativeSqliteStorage</parameter>
- <parameter key="session.storage.memcache.class">Symfony\Component\HttpFoundation\Session\Storage\MemcacheStorage</parameter>
- <parameter key="session.storage.memcached.class">Symfony\Component\HttpFoundation\Session\Storage\MemcachedStorage</parameter>
- <parameter key="session.storage.mock_file.class">Symfony\Component\HttpFoundation\Session\Storage\MockFileStorage</parameter>
+ <parameter key="session.storage.native_file.class">Symfony\Component\HttpFoundation\Session\Storage\NativeFileSessionStorage</parameter>
+ <parameter key="session.storage.null.class">Symfony\Component\HttpFoundation\Session\Storage\NullSessionStorage</parameter>
+ <parameter key="session.storage.native_memcache.class">Symfony\Component\HttpFoundation\Session\Storage\NativeMemcacheSessionStorage</parameter>
+ <parameter key="session.storage.native_memcached.class">Symfony\Component\HttpFoundation\Session\Storage\NativeMemcachedSessionStorage</parameter>
+ <parameter key="session.storage.native_sqlite.class">Symfony\Component\HttpFoundation\Session\Storage\NativeSqliteSessionStorage</parameter>
+ <parameter key="session.storage.memcache.class">Symfony\Component\HttpFoundation\Session\Storage\MemcacheSessionStorage</parameter>
+ <parameter key="session.storage.memcached.class">Symfony\Component\HttpFoundation\Session\Storage\MemcachedSessionStorage</parameter>
+ <parameter key="session.storage.mock_file.class">Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage</parameter>
<parameter key="session.memcache.class">Memcache</parameter>
<parameter key="session.memcached.class">Memcached</parameter>
View
4 src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php
@@ -13,7 +13,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
-use Symfony\Component\HttpFoundation\Session\Storage\MockArrayStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper;
class SessionHelperTest extends \PHPUnit_Framework_TestCase
@@ -24,7 +24,7 @@ public function setUp()
{
$this->request = new Request();
- $session = new Session(new MockArrayStorage());
+ $session = new Session(new MockArraySessionStorage());
$session->set('foobar', 'bar');
$session->getFlashes()->set('notice', 'bar');
View
4 src/Symfony/Bundle/FrameworkBundle/Tests/Templating/PhpEngineTest.php
@@ -15,7 +15,7 @@
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
-use Symfony\Component\HttpFoundation\Session\Storage\MockArrayStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Component\Templating\TemplateNameParser;
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
@@ -64,7 +64,7 @@ protected function getContainer()
{
$container = new Container();
$request = new Request();
- $session = new Session(new MockArrayStorage());
+ $session = new Session(new MockArraySessionStorage());
$request->setSession($session);
$container->set('request', $request);
View
4 src/Symfony/Bundle/TwigBundle/Tests/TwigEngineTest.php
@@ -15,7 +15,7 @@
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
-use Symfony\Component\HttpFoundation\Session\Storage\MockArrayStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Component\Templating\TemplateNameParser;
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables;
@@ -71,7 +71,7 @@ protected function getContainer()
{
$container = new Container();
$request = new Request();
- $session = new Session(new MockArrayStorage());
+ $session = new Session(new MockArraySessionStorage());
$request->setSession($session);
$container->set('request', $request);
View
4 src/Symfony/Component/DependencyInjection/Container.php
@@ -43,8 +43,8 @@
*
* <ul>
* <li>request -> getRequestService()</li>
- * <li>mysql_session_storage -> getMysqlStorageService()</li>
- * <li>symfony.mysql_session_storage -> getSymfony_MysqlStorageService()</li>
+ * <li>mysql_session_storage -> getMysqlSessionStorageService()</li>
+ * <li>symfony.mysql_session_storage -> getSymfony_MysqlSessionStorageService()</li>
* </ul>
*
* The container can have three possible behaviors when a service does not exist:
View
16 src/Symfony/Component/HttpFoundation/Session/Session.php
@@ -11,7 +11,7 @@
namespace Symfony\Component\HttpFoundation\Session;
-use Symfony\Component\HttpFoundation\Session\Storage\StorageInterface;
+use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
@@ -31,18 +31,18 @@ class Session implements SessionInterface
/**
* Storage driver.
*
- * @var StorageInterface
+ * @var SessionStorageInterface
*/
protected $storage;
/**
* Constructor.
*
- * @param StorageInterface $storage A StorageInterface instance.
+ * @param SessionStorageInterface $storage A SessionStorageInterface instance.
* @param AttributeBagInterface $attributes An AttributeBagInterface instance, (defaults null for default AttributeBag)
* @param FlashBagInterface $flashes A FlashBagInterface instance (defaults null for default FlashBag)
*/
- public function __construct(StorageInterface $storage, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null)
+ public function __construct(SessionStorageInterface $storage, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null)
{
$this->storage = $storage;
$this->registerBag($attributes ?: new AttributeBag());
@@ -204,7 +204,7 @@ public function getId()
/**
* Implements the \Serialize interface.
*
- * @return StorageInterface
+ * @return SessionStorageInterface
*/
public function serialize()
{
@@ -214,13 +214,13 @@ public function serialize()
/**
* Implements the \Serialize interface.
*
- * @throws \InvalidArgumentException If the passed string does not unserialize to an instance of StorageInterface
+ * @throws \InvalidArgumentException If the passed string does not unserialize to an instance of SessionStorageInterface
*/
public function unserialize($serialized)
{
$storage = unserialize($serialized);
- if (!$storage instanceof StorageInterface) {
- throw new \InvalidArgumentException('Serialized data did not return a valid instance of StorageInterface');
+ if (!$storage instanceof SessionStorageInterface) {
+ throw new \InvalidArgumentException('Serialized data did not return a valid instance of SessionStorageInterface');
}
$this->storage = $storage;
View
4 ...ttpFoundation/Session/Storage/AbstractStorage.php → ...dation/Session/Storage/AbstractSessionStorage.php
@@ -18,7 +18,7 @@
*
* @author Drak <drak@zikula.org>
*/
-abstract class AbstractStorage implements StorageInterface
+abstract class AbstractSessionStorage implements SessionStorageInterface
{
/**
* Array of SessionBagInterface
@@ -293,7 +293,7 @@ protected function registerSaveHandlers()
{
// note this can be reset to PHP's control using ini_set('session.save_handler', 'files');
// so long as ini_set() is called before the session is started.
- if ($this instanceof SaveHandlerInterface) {
+ if ($this instanceof SessionSaveHandlerInterface) {
session_set_save_handler(
array($this, 'openSession'),
array($this, 'closeSession'),
View
6 ...ttpFoundation/Session/Storage/MemcacheStorage.php → ...dation/Session/Storage/MemcacheSessionStorage.php
@@ -12,11 +12,11 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
- * MemcacheStorage.
+ * MemcacheSessionStorage.
*
* @author Drak <drak@zikula.org>
*/
-class MemcacheStorage extends AbstractStorage implements SaveHandlerInterface
+class MemcacheSessionStorage extends AbstractSessionStorage implements SessionSaveHandlerInterface
{
/**
* Memcache driver.
@@ -46,7 +46,7 @@ class MemcacheStorage extends AbstractStorage implements SaveHandlerInterface
* @param array $memcacheOptions An associative array of Memcachge options
* @param array $options Session configuration options.
*
- * @see AbstractStorage::__construct()
+ * @see AbstractSessionStorage::__construct()
*/
public function __construct(\Memcache $memcache, array $memcacheOptions = array(), array $options = array())
{
View
6 ...tpFoundation/Session/Storage/MemcachedStorage.php → ...ation/Session/Storage/MemcachedSessionStorage.php
@@ -12,11 +12,11 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
- * MemcachedStorage.
+ * MemcachedSessionStorage.
*
* @author Drak <drak@zikula.org>
*/
-class MemcachedStorage extends AbstractStorage implements SaveHandlerInterface
+class MemcachedSessionStorage extends AbstractSessionStorage implements SessionSaveHandlerInterface
{
/**
* Memcached driver.
@@ -39,7 +39,7 @@ class MemcachedStorage extends AbstractStorage implements SaveHandlerInterface
* @param array $memcachedOptions An associative array of Memcached options
* @param array $options Session configuration options.
*
- * @see AbstractStorage::__construct()
+ * @see AbstractSessionStorage::__construct()
*/
public function __construct(\Memcached $memcache, array $memcachedOptions = array(), array $options = array())
{
View
6 ...tpFoundation/Session/Storage/MockArrayStorage.php → ...ation/Session/Storage/MockArraySessionStorage.php
@@ -12,18 +12,18 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
- * MockArrayStorage mocks the session for unit tests.
+ * MockArraySessionStorage mocks the session for unit tests.
*
* No PHP session is actually started since a session can be initialized
* and shutdown only once per PHP execution cycle.
*
- * When doing functional testing, you should use MockFileStorage instead.
+ * When doing functional testing, you should use MockFileSessionStorage instead.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Bulat Shakirzyanov <mallluhuct@gmail.com>
* @author Drak <drak@zikula.org>
*/
-class MockArrayStorage extends AbstractStorage
+class MockArraySessionStorage extends AbstractSessionStorage
{
/**
* @var string
View
6 ...ttpFoundation/Session/Storage/MockFileStorage.php → ...dation/Session/Storage/MockFileSessionStorage.php
@@ -12,7 +12,7 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
- * MockFileStorage is used to mock sessions for
+ * MockFileSessionStorage is used to mock sessions for
* functional testing when done in a single PHP process.
*
* No PHP session is actually started since a session can be initialized
@@ -20,7 +20,7 @@
*
* @author Drak <drak@zikula.org>
*/
-class MockFileStorage extends MockArrayStorage
+class MockFileSessionStorage extends MockArraySessionStorage
{
/**
* @var string
@@ -33,7 +33,7 @@ class MockFileStorage extends MockArrayStorage
* @param string $savePath Path of directory to save session files.
* @param array $options Session options.
*
- * @see AbstractStorage::__construct()
+ * @see AbstractSessionStorage::__construct()
*/
public function __construct($savePath = null, array $options = array())
{
View
6 ...pFoundation/Session/Storage/NativeFileStorage.php → ...tion/Session/Storage/NativeFileSessionStorage.php
@@ -12,13 +12,13 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
- * NativeFileStorage.
+ * NativeFileSessionStorage.
*
* Native session handler using PHP's built in file storage.
*
* @author Drak <drak@zikula.org>
*/
-class NativeFileStorage extends AbstractStorage
+class NativeFileSessionStorage extends AbstractSessionStorage
{
/**
* @var string
@@ -31,7 +31,7 @@ class NativeFileStorage extends AbstractStorage
* @param string $savePath Path of directory to save session files.
* @param array $options Session configuration options.
*
- * @see AbstractStorage::__construct()
+ * @see AbstractSessionStorage::__construct()
*/
public function __construct($savePath = null, array $options = array())
{
View
6 ...ndation/Session/Storage/NativeMemcacheStorage.php → .../Session/Storage/NativeMemcacheSessionStorage.php
@@ -12,13 +12,13 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
- * NativeMemcacheStorage.
+ * NativeMemcacheSessionStorage.
*
* Session based on native PHP memcache database handler.
*
* @author Drak <drak@zikula.org>
*/
-class NativeMemcacheStorage extends AbstractStorage
+class NativeMemcacheSessionStorage extends AbstractSessionStorage
{
/**
* @var string
@@ -31,7 +31,7 @@ class NativeMemcacheStorage extends AbstractStorage
* @param string $savePath Path of memcache server.
* @param array $options Session configuration options.
*
- * @see AbstractStorage::__construct()
+ * @see AbstractSessionStorage::__construct()
*/
public function __construct($savePath = 'tcp://127.0.0.1:11211?persistent=0', array $options = array())
{
View
6 ...dation/Session/Storage/NativeMemcachedStorage.php → ...Session/Storage/NativeMemcachedSessionStorage.php
@@ -12,13 +12,13 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
- * NativeMemcachedStorage.
+ * NativeMemcachedSessionStorage.
*
* Session based on native PHP memcached database handler.
*
* @author Drak <drak@zikula.org>
*/
-class NativeMemcachedStorage extends AbstractStorage
+class NativeMemcachedSessionStorage extends AbstractSessionStorage
{
/**
* @var string
@@ -31,7 +31,7 @@ class NativeMemcachedStorage extends AbstractStorage
* @param string $savePath Comma separated list of servers: e.g. memcache1.example.com:11211,memcache2.example.com:11211
* @param array $options Session configuration options.
*
- * @see AbstractStorage::__construct()
+ * @see AbstractSessionStorage::__construct()
*/
public function __construct($savePath = '127.0.0.1:11211', array $options = array())
{
View
6 ...oundation/Session/Storage/NativeSqliteStorage.php → ...on/Session/Storage/NativeSqliteSessionStorage.php
@@ -12,13 +12,13 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
- * NativeSqliteStorage.
+ * NativeSqliteSessionStorage.
*
* Session based on native PHP sqlite database handler.
*
* @author Drak <drak@zikula.org>
*/
-class NativeSqliteStorage extends AbstractStorage
+class NativeSqliteSessionStorage extends AbstractSessionStorage
{
/**
* @var string
@@ -31,7 +31,7 @@ class NativeSqliteStorage extends AbstractStorage
* @param string $dbPath Path to SQLite database file.
* @param array $options Session configuration options.
*
- * @see AbstractStorage::__construct()
+ * @see AbstractSessionStorage::__construct()
*/
public function __construct($dbPath, array $options = array())
{
View
4 ...nt/HttpFoundation/Session/Storage/NullStorage.php → ...Foundation/Session/Storage/NullSessionStorage.php
@@ -12,7 +12,7 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
- * NullStorage.
+ * NullSessionStorage.
*
* Can be used in unit testing or in a sitation where persisted sessions are not desired.
*
@@ -20,7 +20,7 @@
*
* @api
*/
-class NullStorage extends AbstractStorage implements SaveHandlerInterface
+class NullSessionStorage extends AbstractSessionStorage implements SessionSaveHandlerInterface
{
/**
* {@inheritdoc}
View
8 ...ent/HttpFoundation/Session/Storage/PdoStorage.php → ...pFoundation/Session/Storage/PdoSessionStorage.php
@@ -12,12 +12,12 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
- * PdoStorage.
+ * PdoSessionStorage.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Michael Williams <michael.williams@funsational.com>
*/
-class PdoStorage extends AbstractStorage implements SaveHandlerInterface
+class PdoSessionStorage extends AbstractSessionStorage implements SessionSaveHandlerInterface
{
/**
* PDO instance.
@@ -44,12 +44,12 @@ class PdoStorage extends AbstractStorage implements SaveHandlerInterface
*
* @throws \InvalidArgumentException When "db_table" option is not provided
*
- * @see AbstractStorage::__construct()
+ * @see AbstractSessionStorage::__construct()
*/
public function __construct(\PDO $pdo, array $dbOptions = array(), array $options = array())
{
if (!array_key_exists('db_table', $dbOptions)) {
- throw new \InvalidArgumentException('You must provide the "db_table" option for a PdoStorage.');
+ throw new \InvalidArgumentException('You must provide the "db_table" option for a PdoSessionStorage.');
}
$this->pdo = $pdo;
View
2  ...undation/Session/Storage/SaveHandlerInterface.php → ...n/Session/Storage/SessionSaveHandlerInterface.php
@@ -52,7 +52,7 @@
*
* @author Drak <drak@zikula.org>
*/
-interface SaveHandlerInterface
+interface SessionSaveHandlerInterface
{
/**
* Open session.
View
2  ...tpFoundation/Session/Storage/StorageInterface.php → ...ation/Session/Storage/SessionStorageInterface.php
@@ -21,7 +21,7 @@
*
* @api
*/
-interface StorageInterface
+interface SessionStorageInterface
{
/**
* Starts the session.
View
6 tests/Symfony/Tests/Component/HttpFoundation/RequestTest.php
@@ -12,7 +12,7 @@
namespace Symfony\Tests\Component\HttpFoundation;
-use Symfony\Component\HttpFoundation\Session\Storage\MockArrayStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Request;
@@ -846,7 +846,7 @@ public function testHasSession()
$request = new Request;
$this->assertFalse($request->hasSession());
- $request->setSession(new Session(new MockArrayStorage()));
+ $request->setSession(new Session(new MockArraySessionStorage()));
$this->assertTrue($request->hasSession());
}
@@ -857,7 +857,7 @@ public function testHasPreviousSession()
$this->assertFalse($request->hasPreviousSession());
$request->cookies->set(session_name(), 'foo');
$this->assertFalse($request->hasPreviousSession());
- $request->setSession(new Session(new MockArrayStorage()));
+ $request->setSession(new Session(new MockArraySessionStorage()));
$this->assertTrue($request->hasPreviousSession());
}
View
6 tests/Symfony/Tests/Component/HttpFoundation/Session/SessionTest.php
@@ -14,7 +14,7 @@
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
-use Symfony\Component\HttpFoundation\Session\Storage\MockArrayStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
/**
* SessionTest
@@ -26,7 +26,7 @@
class SessionTest extends \PHPUnit_Framework_TestCase
{
/**
- * @var \Symfony\Component\HttpFoundation\Session\Storage\StorageInterface
+ * @var \Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface
*/
protected $storage;
@@ -37,7 +37,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase
public function setUp()
{
- $this->storage = new MockArrayStorage();
+ $this->storage = new MockArraySessionStorage();
$this->session = new Session($this->storage, new AttributeBag(), new FlashBag());
}
View
22 ...oundation/Session/Storage/AbstractStorageTest.php → ...on/Session/Storage/AbstractSessionStorageTest.php
@@ -2,21 +2,21 @@
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
-use Symfony\Component\HttpFoundation\Session\Storage\AbstractStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
-use Symfony\Component\HttpFoundation\Session\Storage\SaveHandlerInterface;
+use Symfony\Component\HttpFoundation\Session\Storage\SessionSaveHandlerInterface;
/**
- * Turn AbstractStorage into something concrete because
+ * Turn AbstractSessionStorage into something concrete because
* certain mocking features are broken in PHPUnit-Mock-Objects < 1.1.2
* @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/73
*/
-class ConcreteStorage extends AbstractStorage
+class ConcreteSessionStorage extends AbstractSessionStorage
{
}
-class CustomHandlerStorage extends AbstractStorage implements SaveHandlerInterface
+class CustomHandlerSessionStorage extends AbstractSessionStorage implements SessionSaveHandlerInterface
{
public function openSession($path, $id)
{
@@ -44,7 +44,7 @@ public function gcSession($lifetime)
}
/**
- * Test class for AbstractStorage.
+ * Test class for AbstractSessionStorage.
*
* @author Drak <drak@zikula.org>
*
@@ -52,14 +52,14 @@ public function gcSession($lifetime)
*
* @runTestsInSeparateProcesses
*/
-class AbstractStorageTest extends \PHPUnit_Framework_TestCase
+class AbstractSessionStorageTest extends \PHPUnit_Framework_TestCase
{
/**
- * @return AbstractStorage
+ * @return AbstractSessionStorage
*/
protected function getStorage()
{
- $storage = new CustomHandlerStorage();
+ $storage = new CustomHandlerSessionStorage();
$storage->registerBag(new AttributeBag);
return $storage;
@@ -115,13 +115,13 @@ public function testRegenerateDestroy()
public function testCustomSaveHandlers()
{
- $storage = new CustomHandlerStorage();
+ $storage = new CustomHandlerSessionStorage();
$this->assertEquals('user', ini_get('session.save_handler'));
}
public function testNativeSaveHandlers()
{
- $storage = new ConcreteStorage();
+ $storage = new ConcreteSessionStorage();
$this->assertNotEquals('user', ini_get('session.save_handler'));
}
}
View
10 ...undation/Session/Storage/MockArrayStorageTest.php → ...n/Session/Storage/MockArraySessionStorageTest.php
@@ -2,20 +2,20 @@
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
-use Symfony\Component\HttpFoundation\Session\Storage\MockArrayStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
/**
- * Test class for MockArrayStorage.
+ * Test class for MockArraySessionStorage.
*
* @author Drak <drak@zikula.org>
*/
-class MockArrayStorageTest extends \PHPUnit_Framework_TestCase
+class MockArraySessionStorageTest extends \PHPUnit_Framework_TestCase
{
/**
- * @var MockArrayStorage
+ * @var MockArraySessionStorage
*/
private $storage;
@@ -41,7 +41,7 @@ protected function setUp()
$this->flashes->getStorageKey() => array('notice' => 'hello'),
);
- $this->storage = new MockArrayStorage();
+ $this->storage = new MockArraySessionStorage();
$this->storage->registerBag($this->flashes);
$this->storage->registerBag($this->attributes);
$this->storage->setSessionData($this->data);
View
10 ...oundation/Session/Storage/MockFileStorageTest.php → ...on/Session/Storage/MockFileSessionStorageTest.php
@@ -2,16 +2,16 @@
namespace Symfony\Test\Component\HttpFoundation\Session\Storage;
-use Symfony\Component\HttpFoundation\Session\Storage\MockFileStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
/**
- * Test class for MockFileStorage.
+ * Test class for MockFileSessionStorage.
*
* @author Drak <drak@zikula.org>
*/
-class MockFileStorageTest extends \PHPUnit_Framework_TestCase
+class MockFileSessionStorageTest extends \PHPUnit_Framework_TestCase
{
/**
* @var string
@@ -19,7 +19,7 @@ class MockFileStorageTest extends \PHPUnit_Framework_TestCase
private $sessionDir;
/**
- * @var FileMockStorage
+ * @var FileMockSessionStorage
*/
protected $storage;
@@ -96,7 +96,7 @@ public function testMultipleInstances()
private function getStorage(array $options = array())
{
- $storage = new MockFileStorage($this->sessionDir, $options);
+ $storage = new MockFileSessionStorage($this->sessionDir, $options);
$storage->registerBag(new FlashBag);
$storage->registerBag(new AttributeBag);
View
8 ...ndation/Session/Storage/NativeFileStorageTest.php → .../Session/Storage/NativeFileSessionStorageTest.php
@@ -2,20 +2,20 @@
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
-use Symfony\Component\HttpFoundation\Session\Storage\NativeFileStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\NativeFileSessionStorage;
/**
- * Test class for NativeFileStorage.
+ * Test class for NativeFileSessionStorage.
*
* @author Drak <drak@zikula.org>
*
* @runTestsInSeparateProcesses
*/
-class NativeFileStorageTest extends \PHPUnit_Framework_TestCase
+class NativeFileSessionStorageTest extends \PHPUnit_Framework_TestCase
{
public function testSaveHandlers()
{
- $storage = new NativeFileStorage(sys_get_temp_dir(), array('name' => 'TESTING'));
+ $storage = new NativeFileSessionStorage(sys_get_temp_dir(), array('name' => 'TESTING'));
$this->assertEquals('files', ini_get('session.save_handler'));
$this->assertEquals(sys_get_temp_dir(), ini_get('session.save_path'));
$this->assertEquals('TESTING', ini_get('session.name'));
View
8 ...ion/Session/Storage/NativeMemcacheStorageTest.php → ...sion/Storage/NativeMemcacheSessionStorageTest.php
@@ -2,16 +2,16 @@
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
-use Symfony\Component\HttpFoundation\Session\Storage\NativeMemcacheStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\NativeMemcacheSessionStorage;
/**
- * Test class for NativeMemcacheStorage.
+ * Test class for NativeMemcacheSessionStorage.
*
* @author Drak <drak@zikula.org>
*
* @runTestsInSeparateProcesses
*/
-class NativeMemcacheStorageTest extends \PHPUnit_Framework_TestCase
+class NativeMemcacheSessionStorageTest extends \PHPUnit_Framework_TestCase
{
public function testSaveHandlers()
{
@@ -19,7 +19,7 @@ public function testSaveHandlers()
$this->markTestSkipped('Skipped tests SQLite extension is not present');
}
- $storage = new NativeMemcacheStorage('tcp://127.0.0.1:11211?persistent=0', array('name' => 'TESTING'));
+ $storage = new NativeMemcacheSessionStorage('tcp://127.0.0.1:11211?persistent=0', array('name' => 'TESTING'));
$this->assertEquals('memcache', ini_get('session.save_handler'));
$this->assertEquals('tcp://127.0.0.1:11211?persistent=0', ini_get('session.save_path'));
$this->assertEquals('TESTING', ini_get('session.name'));
View
8 ...on/Session/Storage/NativeMemcachedStorageTest.php → ...ion/Storage/NativeMemcachedSessionStorageTest.php
@@ -2,16 +2,16 @@
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
-use Symfony\Component\HttpFoundation\Session\Storage\NativeMemcachedStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\NativeMemcachedSessionStorage;
/**
- * Test class for NativeMemcachedStorage.
+ * Test class for NativeMemcachedSessionStorage.
*
* @author Drak <drak@zikula.org>
*
* @runTestsInSeparateProcesses
*/
-class NativeMemcachedStorageTest extends \PHPUnit_Framework_TestCase
+class NativeMemcachedSessionStorageTest extends \PHPUnit_Framework_TestCase
{
public function testSaveHandlers()
{
@@ -22,7 +22,7 @@ public function testSaveHandlers()
// test takes too long if memcached server is not running
ini_set('memcached.sess_locking', '0');
- $storage = new NativeMemcachedStorage('127.0.0.1:11211', array('name' => 'TESTING'));
+ $storage = new NativeMemcachedSessionStorage('127.0.0.1:11211', array('name' => 'TESTING'));
$this->assertEquals('memcached', ini_get('session.save_handler'));
$this->assertEquals('127.0.0.1:11211', ini_get('session.save_path'));
View
8 ...ation/Session/Storage/NativeSqliteStorageTest.php → ...ession/Storage/NativeSqliteSessionStorageTest.php
@@ -2,16 +2,16 @@
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
-use Symfony\Component\HttpFoundation\Session\Storage\NativeSqliteStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\NativeSqliteSessionStorage;
/**
- * Test class for NativeSqliteStorage.
+ * Test class for NativeSqliteSessionStorage.
*
* @author Drak <drak@zikula.org>
*
* @runTestsInSeparateProcesses
*/
-class NativeSqliteStorageTest extends \PHPUnit_Framework_TestCase
+class NativeSqliteSessionStorageTest extends \PHPUnit_Framework_TestCase
{
public function testSaveHandlers()
{
@@ -19,7 +19,7 @@ public function testSaveHandlers()
$this->markTestSkipped('Skipped tests SQLite extension is not present');
}
- $storage = new NativeSqliteStorage(sys_get_temp_dir().'/sqlite.db', array('name' => 'TESTING'));
+ $storage = new NativeSqliteSessionStorage(sys_get_temp_dir().'/sqlite.db', array('name' => 'TESTING'));
$this->assertEquals('sqlite', ini_get('session.save_handler'));
$this->assertEquals(sys_get_temp_dir().'/sqlite.db', ini_get('session.save_path'));
$this->assertEquals('TESTING', ini_get('session.name'));
View
12 ...ttpFoundation/Session/Storage/NullStorageTest.php → ...dation/Session/Storage/NullSessionStorageTest.php
@@ -1,28 +1,28 @@
<?php
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
-use Symfony\Component\HttpFoundation\Session\Storage\NullStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\NullSessionStorage;
use Symfony\Component\HttpFoundation\Session\Session;
/**
- * Test class for NullStorage.
+ * Test class for NullSessionStorage.
*
* @author Drak <drak@zikula.org>
*
* @runTestsInSeparateProcesses
*/
-class NullStorageTest extends \PHPUnit_Framework_TestCase
+class NullSessionStorageTest extends \PHPUnit_Framework_TestCase
{
public function testSaveHandlers()
{
- $storage = new NullStorage();
+ $storage = new NullSessionStorage();
$this->assertEquals('user', ini_get('session.save_handler'));
}
public function testSession()
{
session_id('nullsessionstorage');
- $storage = new NullStorage();
+ $storage = new NullSessionStorage();
$session = new Session($storage);
$this->assertNull($session->get('something'));
$session->set('something', 'unique');
@@ -32,7 +32,7 @@ public function testSession()
public function testNothingIsPersisted()
{
session_id('nullsessionstorage');
- $storage = new NullStorage();
+ $storage = new NullSessionStorage();
$session = new Session($storage);
$session->start();
$this->assertEquals('nullsessionstorage', $session->getId());
View
4 tests/Symfony/Tests/Component/Security/Http/Firewall/ContextListenerTest.php
@@ -5,7 +5,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\Session;
-use Symfony\Component\HttpFoundation\Session\Storage\MockArrayStorage;
+use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
@@ -63,7 +63,7 @@ public function testOnKernelResponseWillRemoveSession()
protected function runSessionOnKernelResponse($newToken, $original = null)
{
- $session = new Session(new MockArrayStorage());
+ $session = new Session(new MockArraySessionStorage());
if ($original !== null) {
$session->set('_security_session', $original);
Please sign in to comment.
Something went wrong with that request. Please try again.