/** * Configure the firewall based on config mapped to route patterns. Call handlers * to register firewall listeners if the patterns have any rules associated. * * @param ConfigureFirewallEvent $e */ public function onFirewallConfigure(ConfigureFirewallEvent $e) { $request = $e->getRequest(); //loop through rules, call config handlers if any rules match foreach ($this->rules as $pattern => $handlers) { $matcher = new RequestMatcher($pattern); if ($matcher->matches($request)) { foreach ($handlers as $handlerKey => $handlerConfig) { $this->processHandlerConfig($e, $handlerKey, $handlerConfig); } } } }
public function onFirewallConfigure(ConfigureFirewallEvent $event, $config) { $event->addFirewallListener(FirewallEvents::REQUEST, array(new IpRangeFilter($config, IpRangeFilter::WHITELIST), 'onFirewallRequest')); }