* * 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:----nf+EccEk5caRuYro7H7qNrbztwedpWJAC5OAvED/pIklbpvKjmVF/EeEal2X/ImM8qU3FFxkhhLUfVHzCDqKlhDKN2/7Gyv8RoYKRH0b1I3YYD0ES/Gr0m9oiWoSBii//bHYWEnrX4syqQMxC9EfysNyOXIUNS2w9i+sjpTGgxpTGgV+xFaBK+gw46JFHmDWp1/FSU1MAI+Wm8zPmpUnb84V2W9P9q8IlPYpZKRJOztuXJzaxYH8vIRd7ngFJoTiEcMVhM4v/33/v8WJj/tbpZjqBM4zIXAKG6ZEXs/eezx5caBndJabteX9UvT+SfVwTbJn4P79AOIn+K2fH19VozCpYxw3sOWqF+fs7wuNXc+KGhDt0vE8pm9JkAjvBFibD+y9wvNto2l1HjILHm4Uu/wobMGbY7MVAuMJJQ1MgagnwcALo1vRJx7TDUgVu5U1+G8oFNhjwPGJYvmVtxdfiZQuAA1KeYh884+TnMZ7U3kqWpT4C8yRSwvjJuFyLISCsPU72GcYlIGfyU0duli8GEOFdqD3GqgSt0x+/lWz3g0WqoMerC/imeWNrsjLZBA94o8/pcIgqPzqAorQiqKhU6d+SI31LK2Hg2lb5cAekkz/JyqYH64PqFuTbbZAebdwOELmGb2JlgXv16spA1mXO2HOALzwQmIjXuMtqq3Jer4=----ATTACHMENT:----Mjk1OTA3MTY0MTg5MDI5MSA2MjY4OTA3MDMyNDQ5NDg3IDMyNjE1MzE4OTQ1NDE2Mzg=