Skip to content

Commit

Permalink
changed the Firewall to be a proper subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Nov 6, 2012
1 parent 02bd359 commit af87c2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -106,7 +106,7 @@

<!-- Firewall related services -->
<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="event_dispatcher" />
</service>
Expand Down
9 changes: 8 additions & 1 deletion src/Symfony/Component/Security/Http/Firewall.php
Expand Up @@ -12,8 +12,10 @@
namespace Symfony\Component\Security\Http;

use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
* Firewall uses a FirewallMap to register security listeners for the given
Expand All @@ -25,7 +27,7 @@
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Firewall
class Firewall implements EventSubscriberInterface
{
private $map;
private $dispatcher;
Expand Down Expand Up @@ -68,4 +70,9 @@ public function onKernelRequest(GetResponseEvent $event)
}
}
}

public static function getSubscribedEvents()
{
return array(KernelEvents::REQUEST => array('onKernelRequest', 8));
}
}

0 comments on commit af87c2b

Please sign in to comment.