changed the Firewall to be a proper subscriber
This commit is contained in:
parent
02bd35905e
commit
af87c2b00b
@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
<!-- Firewall related services -->
|
<!-- Firewall related services -->
|
||||||
<service id="security.firewall" class="%security.firewall.class%">
|
<service id="security.firewall" class="%security.firewall.class%">
|
||||||
<tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="8" />
|
<tag name="kernel.event_subscriber" />
|
||||||
<argument type="service" id="security.firewall.map" />
|
<argument type="service" id="security.firewall.map" />
|
||||||
<argument type="service" id="event_dispatcher" />
|
<argument type="service" id="event_dispatcher" />
|
||||||
</service>
|
</service>
|
||||||
|
@ -12,8 +12,10 @@
|
|||||||
namespace Symfony\Component\Security\Http;
|
namespace Symfony\Component\Security\Http;
|
||||||
|
|
||||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||||
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Firewall uses a FirewallMap to register security listeners for the given
|
* Firewall uses a FirewallMap to register security listeners for the given
|
||||||
@ -25,7 +27,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
|||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*/
|
*/
|
||||||
class Firewall
|
class Firewall implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
private $map;
|
private $map;
|
||||||
private $dispatcher;
|
private $dispatcher;
|
||||||
@ -68,4 +70,9 @@ class Firewall
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getSubscribedEvents()
|
||||||
|
{
|
||||||
|
return array(KernelEvents::REQUEST => array('onKernelRequest', 8));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user