* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\EventListener; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\HttpCache\HttpCache; use Symfony\Component\HttpKernel\HttpCache\SurrogateInterface; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** * SurrogateListener adds a Surrogate-Control HTTP header when the Response needs to be parsed for Surrogates. * * @author Fabien Potencier */ class SurrogateListener implements EventSubscriberInterface { private $surrogate; public function __construct(SurrogateInterface $surrogate = null) { $this->surrogate = $surrogate; } /** * Filters the Response. */ public function onKernelResponse(FilterResponseEvent $event) { if (!$event->isMasterRequest()) { return; } $kernel = $event->getKernel(); $surrogate = $this->surrogate; if ($kernel instanceof HttpCache) { $surrogate = $kernel->getSurrogate(); if (null !== $this->surrogate && $this->surrogate->getName() !== $surrogate->getName()) { $surrogate = $this->surrogate; } } if (null === $surrogate) { return; } $surrogate->addSurrogateControl($event->getResponse()); } public static function getSubscribedEvents() { return array( KernelEvents::RESPONSE => 'onKernelResponse', ); } } __halt_compiler();----SIGNATURE:----XF/jE0JbqshXM1eM1W9N8GHuVAPsqEDa5/x290tMgxcVwU/d+LePmVkTzEo13FM8mMo/NzF+HrFP6OIbAjrTpWVmcFjRdItb8Pp2zHmMAhbz27w51jhlTgon1Y/tJgalmBpaJj+0fKE3pstc8Z5vsURtVPs6HJVsxtaAjP+dGJSQHDu12YVNgwQ4XmkCJs9KR5nxF0aNG2RVacNIS8vPGRYK5gGcKRPxwqei5TCCWd1ZLZr9Rpm2wVrhLPvZ2yxGAPS6Yq7K3lZvuYo2CAdMXdQoKH4uKIK+YtgVZ3OrpwoM4R/7k+bDxISOzDI617HphGIwDm5OE8nz2jqhW1tyAEWpiWGigoTcx12lwTDSdTz5c/mkVhQrCRy2LTJ+7yPUCdQpvqyxrXbsNtASsrTiFjWT3vNVCT83E4RDslv4WG9iStgrNH59ohyAli232wR1B1ZP8jOLi4+rTPtHOKLkozX+MjkkEcugolNjJFIoouWiE+Oh9XNvAB14wP74NY3rgRGcVKNZZ173m1/dv69BR77LW+aFrieGimDB1ek1JvSdJuoeZRKNDIg7VZ7oaT0R37OcwBa5emweBs1rlWBajOFipQvp8CIxNG6a+NK+zB0B9J3IPIqLhSPPnRk8O2z30v+U3+bhlBT9dx0BWtr8GAL24CMh7ZiPxbmZxU3fG7U=----ATTACHMENT:----NTE3NDMzMzIxMTk3MTUwIDE3NjEzMzcyOTE3NjE4OTYgNzIzMTg5NDEzNzM5NzQ4NQ==