moved all listener classes under a common EventListener sub-namespace

This commit is contained in:
Fabien Potencier 2011-05-31 10:09:25 +02:00
parent 7d999acd0b
commit 839c332438
24 changed files with 41 additions and 39 deletions

View File

@ -9,7 +9,7 @@
* with this source code in the file LICENSE.
*/
namespace Symfony\Bundle\AsseticBundle\Listener;
namespace Symfony\Bundle\AsseticBundle\EventListener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;

View File

@ -9,7 +9,7 @@
<parameter key="assetic.routing_loader.class">Symfony\Bundle\AsseticBundle\Routing\AsseticLoader</parameter>
<parameter key="assetic.cache.class">Assetic\Cache\FilesystemCache</parameter>
<parameter key="assetic.use_controller_worker.class">Symfony\Bundle\AsseticBundle\Factory\Worker\UseControllerWorker</parameter>
<parameter key="assetic.request_listener.class">Symfony\Bundle\AsseticBundle\Listener\RequestListener</parameter>
<parameter key="assetic.request_listener.class">Symfony\Bundle\AsseticBundle\EventListener\RequestListener</parameter>
</parameters>
<services>

View File

@ -118,7 +118,7 @@ class FrameworkExtension extends Extension
'Symfony\\Component\\EventDispatcher\\EventSubscriberInterface',
'Symfony\\Component\\HttpKernel\\HttpKernel',
'Symfony\\Component\\HttpKernel\\ResponseListener',
'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener',
'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver',
'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface',
'Symfony\\Component\\HttpKernel\\Event\\KernelEvent',
@ -129,7 +129,7 @@ class FrameworkExtension extends Extension
'Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent',
'Symfony\\Component\\HttpKernel\\CoreEvents',
'Symfony\\Bundle\\FrameworkBundle\\Listener\\RouterListener',
'Symfony\\Bundle\\FrameworkBundle\\EventListener\\RouterListener',
'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser',
'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver',
'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller',
@ -296,7 +296,7 @@ class FrameworkExtension extends Extension
$container->setParameter('session.storage.options', $options);
$this->addClassesToCompile(array(
'Symfony\\Bundle\\FrameworkBundle\\Listener\\SessionListener',
'Symfony\\Bundle\\FrameworkBundle\\EventListener\\SessionListener',
'Symfony\\Component\\HttpFoundation\\SessionStorage\\SessionStorageInterface',
$container->getDefinition('session')->getClass(),
));

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Listener;
namespace Symfony\Bundle\FrameworkBundle\EventListener;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Listener;
namespace Symfony\Bundle\FrameworkBundle\EventListener;
use Symfony\Component\DependencyInjection\ContainerInterface;

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Test;
namespace Symfony\Bundle\FrameworkBundle\EventListener;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@ -20,14 +20,14 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* SessionListener.
* TestSessionListener.
*
* Saves session in test environment.
*
* @author Bulat Shakirzyanov <mallluhuct@gmail.com>
* @author Fabien Potencier <fabien@symfony.com>
*/
class SessionListener
class TestSessionListener
{
protected $container;

View File

@ -6,7 +6,7 @@
<parameters>
<parameter key="esi.class">Symfony\Component\HttpKernel\HttpCache\Esi</parameter>
<parameter key="esi_listener.class">Symfony\Component\HttpKernel\HttpCache\EsiListener</parameter>
<parameter key="esi_listener.class">Symfony\Component\HttpKernel\EventListener\EsiListener</parameter>
</parameters>
<services>

View File

@ -6,7 +6,7 @@
<parameters>
<parameter key="profiler.class">Symfony\Component\HttpKernel\Profiler\Profiler</parameter>
<parameter key="profiler_listener.class">Symfony\Component\HttpKernel\ProfilerListener</parameter>
<parameter key="profiler_listener.class">Symfony\Component\HttpKernel\EventListener\ProfilerListener</parameter>
</parameters>
<services>

View File

@ -9,7 +9,7 @@
<parameter key="test.client.parameters" type="collection"></parameter>
<parameter key="test.client.history.class">Symfony\Component\BrowserKit\History</parameter>
<parameter key="test.client.cookiejar.class">Symfony\Component\BrowserKit\CookieJar</parameter>
<parameter key="test.session.listener.class">Symfony\Bundle\FrameworkBundle\Test\SessionListener</parameter>
<parameter key="test.session.listener.class">Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener</parameter>
</parameters>
<services>

View File

@ -5,12 +5,12 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="router_listener.class">Symfony\Bundle\FrameworkBundle\Listener\RouterListener</parameter>
<parameter key="session_listener.class">Symfony\Bundle\FrameworkBundle\Listener\SessionListener</parameter>
<parameter key="router_listener.class">Symfony\Bundle\FrameworkBundle\EventListener\RouterListener</parameter>
<parameter key="session_listener.class">Symfony\Bundle\FrameworkBundle\EventListener\SessionListener</parameter>
<parameter key="controller_resolver.class">Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver</parameter>
<parameter key="controller_name_converter.class">Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser</parameter>
<parameter key="response_listener.class">Symfony\Component\HttpKernel\ResponseListener</parameter>
<parameter key="exception_listener.class">Symfony\Component\HttpKernel\Debug\ExceptionListener</parameter>
<parameter key="response_listener.class">Symfony\Component\HttpKernel\EventListener\ResponseListener</parameter>
<parameter key="exception_listener.class">Symfony\Component\HttpKernel\EventListener\ExceptionListener</parameter>
</parameters>
<services>

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests;
namespace Symfony\Bundle\FrameworkBundle\Tests\EventListener;
use Symfony\Bundle\FrameworkBundle\Listener\RouterListener;
use Symfony\Bundle\FrameworkBundle\EventListener\RouterListener;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Test;
namespace Symfony\Bundle\FrameworkBundle\Tests\EventListener;
use Symfony\Bundle\FrameworkBundle\Test\SessionListener;
use Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
@ -24,14 +24,14 @@ use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
*
* @author Bulat Shakirzyanov <mallluhuct@gmail.com>
*/
class SessionListenerTest extends \PHPUnit_Framework_TestCase
class TestSessionListenerTest extends \PHPUnit_Framework_TestCase
{
private $listener;
private $session;
public function setUp()
{
$this->listener = new SessionListener($this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'));
$this->listener = new TestSessionListener($this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'));
$this->session = $this->getSession();
}

View File

@ -1,6 +1,6 @@
<?php
namespace Symfony\Bundle\SecurityBundle;
namespace Symfony\Bundle\SecurityBundle\EventListener;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;

View File

@ -13,7 +13,7 @@
<parameter key="security.authentication.rememberme.services.persistent.class">Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices</parameter>
<parameter key="security.authentication.rememberme.services.simplehash.class">Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices</parameter>
<parameter key="security.rememberme.response_listener.class">Symfony\Bundle\SecurityBundle\ResponseListener</parameter>
<parameter key="security.rememberme.response_listener.class">Symfony\Bundle\SecurityBundle\EventListener\ResponseListener</parameter>
</parameters>
<services>

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\WebProfilerBundle;
namespace Symfony\Bundle\WebProfilerBundle\EventListener;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

View File

@ -5,7 +5,7 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="web_profiler.debug_toolbar.class">Symfony\Bundle\WebProfilerBundle\WebDebugToolbarListener</parameter>
<parameter key="web_profiler.debug_toolbar.class">Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener</parameter>
</parameters>
<services>

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\WebProfilerBundle\Tests;
namespace Symfony\Bundle\WebProfilerBundle\Tests\EventListener;
use Symfony\Bundle\WebProfilerBundle\WebDebugToolbarListener;
use Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -9,11 +9,12 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\HttpCache;
namespace Symfony\Component\HttpKernel\EventListener;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\HttpCache\Esi;
/**
* EsiListener adds a Surrogate-Control HTTP header when the Response needs to be parsed for ESI.

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Debug;
namespace Symfony\Component\HttpKernel\EventListener;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel;
namespace Symfony\Component\HttpKernel\EventListener;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -9,10 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel;
namespace Symfony\Component\HttpKernel\EventListener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
/**
* ResponseListener fixes the Response Content-Type.

View File

@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Component\HttpKernel\HttpCache;
namespace Symfony\Tests\Component\HttpKernel\EventListener;
use Symfony\Component\HttpKernel\HttpCache\Esi;
use Symfony\Component\HttpKernel\HttpCache\EsiListener;
use Symfony\Component\HttpKernel\EventListener\EsiListener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\CoreEvents;
use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Component\HttpKernel\Debug;
namespace Symfony\Tests\Component\HttpKernel\EventListener;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Debug\ExceptionListener;
use Symfony\Component\HttpKernel\EventListener\ExceptionListener;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpFoundation\Request;

View File

@ -9,9 +9,9 @@
* file that was distributed with this source code.
*/
namespace Symfony\Tests\Component\HttpKernel;
namespace Symfony\Tests\Component\HttpKernel\EventListener;
use Symfony\Component\HttpKernel\ResponseListener;
use Symfony\Component\HttpKernel\EventListener\ResponseListener;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;