[HttpFoundation] Moved session related classes to own sub-namespace.
This commit is contained in:
parent
468391525a
commit
27530cbb1e
@ -229,6 +229,8 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
|
||||
* removed the ContentTypeMimeTypeGuesser class as it is deprecated and never used on PHP 5.3
|
||||
* added ResponseHeaderBag::makeDisposition() (implements RFC 6266)
|
||||
* made mimetype to extension conversion configurable
|
||||
* [BC BREAK] Moved all session related classes and interfaces into own namespace, as
|
||||
`Symfony\Component\HttpFoudation\Session`.
|
||||
* Flashes are now stored as a bucket of messages per `$type` so there can be multiple messages per type.
|
||||
There are four interface constants for type, `FlashBagInterface::INFO`, `FlashBagInterface::NOTICE`,
|
||||
`FlashBagInterface::WARNING` and `FlashBagInterface::ERROR`.
|
||||
|
@ -270,8 +270,8 @@ UPGRADE FROM 2.0 to 2.1
|
||||
.. note::
|
||||
|
||||
The Flash Message API provides constants which you can optionally use. For example
|
||||
`Symfony\Component\HttpFoundation\SessionFlash\FlashBag::NOTICE`, which can also be abbreviated to
|
||||
`FlashBag::NOTICE` providing you declare `<?php use Symfony\Component\HttpFoundation\SessionFlash\FlashBag; ?>`
|
||||
`Symfony\Component\HttpFoundation\Session\Flash\FlashBag::NOTICE`, which can also be abbreviated to
|
||||
`FlashBag::NOTICE` providing you declare `<?php use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; ?>`
|
||||
at the beginning of the PHP template.
|
||||
|
||||
Before (Twig):
|
||||
@ -301,7 +301,7 @@ UPGRADE FROM 2.0 to 2.1
|
||||
.. note::
|
||||
|
||||
You can optionally use constants in Twig templates using `constant()` e.g.
|
||||
`constant('Symfony\Component\HttpFoundation\SessionFlash\FlashBag::NOTICE')`.
|
||||
`constant('Symfony\Component\HttpFoundation\Session\Flash\FlashBag::NOTICE')`.
|
||||
|
||||
* Session object
|
||||
|
||||
@ -313,12 +313,12 @@ UPGRADE FROM 2.0 to 2.1
|
||||
* Session storage drivers
|
||||
|
||||
Session storage drivers should inherit from
|
||||
`Symfony\Component\HttpFoundation\SessionStorage\AbstractSessionStorage`
|
||||
`Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage`
|
||||
and no longer should implement `read()`, `write()`, `remove()` which were removed from the
|
||||
`SessionStorageInterface`.
|
||||
|
||||
Any session storage driver that wants to use custom save handlers should
|
||||
implement `Symfony\Component\HttpFoundation\SessionStorage\SessionSaveHandlerInterface`
|
||||
implement `Symfony\Component\HttpFoundation\Session\Storage\SessionSaveHandlerInterface`
|
||||
|
||||
### [FrameworkBundle]
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
namespace Symfony\Bridge\Doctrine\HttpFoundation;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySqlPlatform;
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\AbstractSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\SessionSaveHandlerInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\AbstractSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\SessionSaveHandlerInterface;
|
||||
use Doctrine\DBAL\Driver\Connection;
|
||||
|
||||
/**
|
||||
|
@ -301,7 +301,7 @@ class FrameworkExtension extends Extension
|
||||
|
||||
$this->addClassesToCompile(array(
|
||||
'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener',
|
||||
'Symfony\\Component\\HttpFoundation\\SessionStorage\\SessionStorageInterface',
|
||||
'Symfony\\Component\\HttpFoundation\\Session\Storage\\SessionStorageInterface',
|
||||
$container->getDefinition('session')->getClass(),
|
||||
));
|
||||
|
||||
|
@ -5,17 +5,17 @@
|
||||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
||||
|
||||
<parameters>
|
||||
<parameter key="session.class">Symfony\Component\HttpFoundation\Session</parameter>
|
||||
<parameter key="session.flashbag.class">Symfony\Component\HttpFoundation\SessionFlash\FlashBag</parameter>
|
||||
<parameter key="session.attribute_bag.class">Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag</parameter>
|
||||
<parameter key="session.storage.native_file.class">Symfony\Component\HttpFoundation\SessionStorage\NativeFileSessionStorage</parameter>
|
||||
<parameter key="session.storage.null.class">Symfony\Component\HttpFoundation\SessionStorage\NullSessionStorage</parameter>
|
||||
<parameter key="session.storage.native_memcache.class">Symfony\Component\HttpFoundation\SessionStorage\NativeMemcacheSessionStorage</parameter>
|
||||
<parameter key="session.storage.native_memcached.class">Symfony\Component\HttpFoundation\SessionStorage\NativeMemcachedSessionStorage</parameter>
|
||||
<parameter key="session.storage.native_sqlite.class">Symfony\Component\HttpFoundation\SessionStorage\NativeSqliteSessionStorage</parameter>
|
||||
<parameter key="session.storage.memcache.class">Symfony\Component\HttpFoundation\SessionStorage\MemcacheSessionStorage</parameter>
|
||||
<parameter key="session.storage.memcached.class">Symfony\Component\HttpFoundation\SessionStorage\MemcachedSessionStorage</parameter>
|
||||
<parameter key="session.storage.mock_file.class">Symfony\Component\HttpFoundation\SessionStorage\MockFileSessionStorage</parameter>
|
||||
<parameter key="session.class">Symfony\Component\HttpFoundation\Session\Session</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_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>
|
||||
|
||||
|
@ -79,7 +79,7 @@ class GlobalVariables
|
||||
/**
|
||||
* Returns the current session.
|
||||
*
|
||||
* @return Symfony\Component\HttpFoundation\Session|void The session
|
||||
* @return Symfony\Component\HttpFoundation\Session\Session|void The session
|
||||
*/
|
||||
public function getSession()
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ namespace Symfony\Bundle\FrameworkBundle\Templating\Helper;
|
||||
|
||||
use Symfony\Component\Templating\Helper\Helper;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
|
||||
|
||||
/**
|
||||
* SessionHelper provides read-only access to the session attributes.
|
||||
|
@ -94,7 +94,7 @@ class TestSessionListenerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
private function getSession()
|
||||
{
|
||||
return $this->getMockBuilder('Symfony\Component\HttpFoundation\Session')
|
||||
return $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Session')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
}
|
||||
|
@ -12,11 +12,11 @@
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session;
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\MockArraySessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||
use Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
|
||||
class SessionHelperTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
@ -14,8 +14,8 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Templating;
|
||||
use Symfony\Bundle\FrameworkBundle\Templating\PhpEngine;
|
||||
use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session;
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\MockArraySessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||
use Symfony\Component\Templating\TemplateNameParser;
|
||||
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables;
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
|
||||
|
@ -14,8 +14,8 @@ namespace Symfony\Bundle\TwigBundle\Tests;
|
||||
use Symfony\Bundle\TwigBundle\TwigEngine;
|
||||
use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session;
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\MockArraySessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||
use Symfony\Component\Templating\TemplateNameParser;
|
||||
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables;
|
||||
|
||||
|
@ -15,7 +15,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
||||
use Symfony\Bundle\TwigBundle\TwigEngine;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\AutoExpireFlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag;
|
||||
|
||||
/**
|
||||
* WebDebugToolbarListener injects the Web Debug Toolbar.
|
||||
|
@ -177,7 +177,7 @@ class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
protected function getRequestMock($isXmlHttpRequest = false, $requestFormat = 'html')
|
||||
{
|
||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session', array(), array(), '', false);
|
||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session', array(), array(), '', false);
|
||||
$request = $this->getMock(
|
||||
'Symfony\Component\HttpFoundation\Request',
|
||||
array('getSession', 'isXmlHttpRequest', 'getRequestFormat'),
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Session;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
|
||||
/**
|
||||
* This provider uses a Symfony2 Session object to retrieve the user's
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Symfony\Component\HttpFoundation;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
|
||||
/**
|
||||
* Request represents an HTTP request.
|
||||
@ -124,7 +124,7 @@ class Request
|
||||
protected $format;
|
||||
|
||||
/**
|
||||
* @var \Symfony\Component\HttpFoundation\SessionInterface
|
||||
* @var \Symfony\Component\HttpFoundation\Session\SessionInterface
|
||||
*/
|
||||
protected $session;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionAttribute;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Attribute;
|
||||
|
||||
/**
|
||||
* This class relates to session attribute storage
|
@ -9,9 +9,9 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionAttribute;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Attribute;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
|
||||
|
||||
/**
|
||||
* Attributes store.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionAttribute;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Attribute;
|
||||
|
||||
/**
|
||||
* This class provides structured storage of session attributes using
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionFlash;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Flash;
|
||||
|
||||
/**
|
||||
* AutoExpireFlashBag flash message container.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionFlash;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Flash;
|
||||
|
||||
/**
|
||||
* FlashBag flash message container.
|
@ -9,9 +9,9 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionFlash;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Flash;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
|
||||
|
||||
/**
|
||||
* FlashBagInterface.
|
@ -9,14 +9,14 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation;
|
||||
namespace Symfony\Component\HttpFoundation\Session;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\SessionStorageInterface;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBagInterface;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBagInterface;
|
||||
use Symfony\Component\HttpFoundation\SessionBagInterface;
|
||||
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;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
|
||||
|
||||
/**
|
||||
* Session.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation;
|
||||
namespace Symfony\Component\HttpFoundation\Session;
|
||||
|
||||
/**
|
||||
* Session Bag store.
|
@ -9,10 +9,10 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation;
|
||||
namespace Symfony\Component\HttpFoundation\Session;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\AttributeInterface;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\AttributeInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
|
||||
|
||||
/**
|
||||
* Interface for the session.
|
@ -9,13 +9,13 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBagInterface;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBagInterface;
|
||||
use Symfony\Component\HttpFoundation\SessionBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
|
||||
|
||||
/**
|
||||
* This provides a base class for session attribute storage.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* MemcacheSessionStorage.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* MemcachedSessionStorage.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* MockArraySessionStorage mocks the session for unit tests.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* MockFileSessionStorage is used to mock sessions for
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* NativeFileSessionStorage.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* NativeMemcacheSessionStorage.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* NativeMemcachedSessionStorage.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* NativeSqliteSessionStorage.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* NullSessionStorage.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* PdoSessionStorage.
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
/**
|
||||
* Session Savehandler Interface.
|
@ -9,12 +9,12 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
|
||||
|
||||
/**
|
||||
* SessionStorageInterface.
|
||||
* StorageInterface.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Drak <drak@zikula.org>
|
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\SessionStorage;
|
||||
|
||||
/**
|
||||
* ArraySessionStorage mocks the session for unit tests.
|
||||
*
|
||||
* BC Class for MockArraySessionStorage
|
||||
*
|
||||
* @deprecated since 2.1.0
|
||||
* @see MockArraySessionStorage
|
||||
*
|
||||
* 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 FileMockSessionStorage instead.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Bulat Shakirzyanov <mallluhuct@gmail.com>
|
||||
*/
|
||||
class ArraySessionStorage extends MockArraySessionStorage
|
||||
{
|
||||
}
|
@ -21,7 +21,7 @@ class SessionCsrfProviderTest extends \PHPUnit_Framework_TestCase
|
||||
protected function setUp()
|
||||
{
|
||||
$this->session = $this->getMock(
|
||||
'Symfony\Component\HttpFoundation\Session',
|
||||
'Symfony\Component\HttpFoundation\Session\Session',
|
||||
array(),
|
||||
array(),
|
||||
'',
|
||||
|
@ -12,8 +12,8 @@
|
||||
namespace Symfony\Tests\Component\HttpFoundation;
|
||||
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\MockArraySessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session\Attribute;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
|
||||
|
||||
/**
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\NamespacedAttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag;
|
||||
|
||||
/**
|
||||
* Tests NamespacedAttributeBag
|
@ -9,10 +9,10 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session\Flash;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\AutoExpireFlashBag as FlashBag;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag as FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
|
||||
|
||||
/**
|
||||
* AutoExpireFlashBagTest
|
||||
@ -22,7 +22,7 @@ use Symfony\Component\HttpFoundation\SessionFlash\FlashBagInterface;
|
||||
class AutoExpireFlashBagTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var \Symfony\Component\HttpFoundation\SessionFlash\FlashBagInterface
|
||||
* @var \Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface
|
||||
*/
|
||||
private $bag;
|
||||
|
@ -9,10 +9,10 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session\Flash;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
|
||||
|
||||
/**
|
||||
* FlashBagTest
|
@ -9,14 +9,14 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Session;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBagInterface;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBagInterface;
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\MockArraySessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||
|
||||
/**
|
||||
* SessionTest
|
||||
@ -28,12 +28,12 @@ use Symfony\Component\HttpFoundation\SessionStorage\MockArraySessionStorage;
|
||||
class SessionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var \Symfony\Component\HttpFoundation\SessionStorage\SessionStorageInterface
|
||||
* @var \Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface
|
||||
*/
|
||||
protected $storage;
|
||||
|
||||
/**
|
||||
* @var \Symfony\Component\HttpFoundation\SessionInterface
|
||||
* @var \Symfony\Component\HttpFoundation\Session\SessionInterface
|
||||
*/
|
||||
protected $session;
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\AbstractSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\SessionSaveHandlerInterface;
|
||||
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\SessionSaveHandlerInterface;
|
||||
|
||||
/**
|
||||
* Turn AbstractSessionStorage into something concrete because
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\MockArraySessionStorage;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
|
||||
|
||||
/**
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Test\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Test\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\MockFileSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
|
||||
/**
|
||||
* Test class for MockFileSessionStorage.
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\NativeFileSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\NativeFileSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
|
||||
/**
|
||||
* Test class for NativeFileSessionStorage.
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\NativeMemcacheSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\NativeMemcacheSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
|
||||
/**
|
||||
* Test class for NativeMemcacheSessionStorage.
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\NativeMemcachedSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\NativeMemcachedSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
|
||||
/**
|
||||
* Test class for NativeMemcachedSessionStorage.
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation\SessionStorage;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
|
||||
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\NativeSqliteSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\SessionAttribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\SessionFlash\FlashBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\NativeSqliteSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
|
||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
||||
|
||||
/**
|
||||
* Test class for NativeSqliteSessionStorage.
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Tests\Component\HttpFoundation\SessionStorage;
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\NullSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session;
|
||||
namespace Symfony\Tests\Component\HttpFoundation\Session\Storage;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\NullSessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
|
||||
/**
|
||||
* Test class for NullSessionStorage.
|
@ -33,7 +33,7 @@ class LocaleListenerTest extends \PHPUnit_Framework_TestCase
|
||||
session_name('foo');
|
||||
$request->cookies->set('foo', 'value');
|
||||
|
||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session', array('get'), array(), '', false);
|
||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session', array('get'), array(), '', false);
|
||||
$session->expects($this->once())->method('get')->will($this->returnValue('es'));
|
||||
$request->setSession($session);
|
||||
|
||||
@ -55,7 +55,7 @@ class LocaleListenerTest extends \PHPUnit_Framework_TestCase
|
||||
$event = $this->getEvent($request);
|
||||
|
||||
// also updates the session _locale value
|
||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session', array('set', 'get'), array(), '', false);
|
||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session', array('set', 'get'), array(), '', false);
|
||||
$session->expects($this->once())->method('set')->with('_locale', 'es');
|
||||
$session->expects($this->once())->method('get')->with('_locale')->will($this->returnValue('es'));
|
||||
$request->setSession($session);
|
||||
|
@ -4,8 +4,8 @@ namespace Symfony\Test\Component\Security\Http\Firewall;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session;
|
||||
use Symfony\Component\HttpFoundation\SessionStorage\MockArraySessionStorage;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
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;
|
||||
|
@ -22,7 +22,7 @@ class SessionLogoutHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$request = $this->getMock('Symfony\Component\HttpFoundation\Request');
|
||||
$response = new Response();
|
||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session', array(), array(), '', false);
|
||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session', array(), array(), '', false);
|
||||
|
||||
$request
|
||||
->expects($this->once())
|
||||
|
Reference in New Issue
Block a user