* * 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:----mQVCCqGbMfG1ZlywjxenlNIBW6zoR/dKbzMqLMMJ2qDk3HnAIcXIZEKKAqfXGht89gdQCh3MCeQKbTvjkDOY/Ce/ISaiUxs4AdvD8kjUwRxbTLDCV5j9npkJCvNAiJNsRSZsMwHTdXvDSYPaSeXRZKJIgAfkh92wv7zCpQS98qJommPwkIOhY7gq2M+fYWOxQdz/Zr+DetxlhD8t5ES740mZInLF+EccjEe2p8Kwq8VaJ9E4pkcByvEH+olloHiMtwMaghfOJ0RDlR3M3RkStdn0iUi8iDv2nY5gW8c/DayWzS+lFwYfJxa0BOwTNH1CJbLQR9ITWaE9EtGS4GOPLHVjzav0+pBbuX9BNwIbch3rC2e9XAZzVGct87S6I41oZnUTKkgaPdpWYdVljziZllC1SJ5+TQSPXlUMMWv0hLw8SpR5qVXE+3DjnVEZDnUc7aZ8waDxAfXIgYY1bMQD60cMtXQ9HF6QDtLB3UxO+qmwpngJaf/z+iVa1MUTMq4vktKiJsSKaUBtf+n1OKK8W5GGRmUsZfqVpmPDSyPSIOX1V7mv4GihEQrvGfpNQLWjrG5q3kMcyLimyezo/tEjEetYT9XDMEoRKSRrt4XVb/KM+7q0KbIparpcGG0h6TWUlUxDb5fSvx/t3iGgBf3UvPVRCFQ7w/p6pCZ3KdlcA3o=----ATTACHMENT:----NjgzMzc2NTA2MzkwMDE4NyA4NzMxODE3NTI3MzMzOTA3IDM5ODgwOTI1NTE5NDE5NzI=