4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\EventListener;
14 use Symfony\Component\HttpFoundation\StreamedResponse;
15 use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
16 use Symfony\Component\HttpKernel\KernelEvents;
17 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
20 * StreamedResponseListener is responsible for sending the Response
23 * @author Fabien Potencier <fabien@symfony.com>
25 class StreamedResponseListener implements EventSubscriberInterface
28 * Filters the Response.
30 * @param FilterResponseEvent $event A FilterResponseEvent instance
32 public function onKernelResponse(FilterResponseEvent $event)
34 if (!$event->isMasterRequest()) {
38 $response = $event->getResponse();
40 if ($response instanceof StreamedResponse) {
45 public static function getSubscribedEvents()
48 KernelEvents::RESPONSE => array('onKernelResponse', -1024),