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\EventDispatcher\EventSubscriberInterface;
15 use Symfony\Component\HttpFoundation\StreamedResponse;
16 use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
17 use Symfony\Component\HttpKernel\KernelEvents;
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 public function onKernelResponse(FilterResponseEvent $event)
32 if (!$event->isMasterRequest()) {
36 $response = $event->getResponse();
38 if ($response instanceof StreamedResponse) {
43 public static function getSubscribedEvents()
46 KernelEvents::RESPONSE => array('onKernelResponse', -1024),