You are here

class StreamedResponseListener in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/EventListener/StreamedResponseListener.php \Symfony\Component\HttpKernel\EventListener\StreamedResponseListener

StreamedResponseListener is responsible for sending the Response to the client.

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

Expanded class hierarchy of StreamedResponseListener

File

vendor/symfony/http-kernel/EventListener/StreamedResponseListener.php, line 25

Namespace

Symfony\Component\HttpKernel\EventListener
View source
class StreamedResponseListener implements EventSubscriberInterface {

  /**
   * Filters the Response.
   *
   * @param FilterResponseEvent $event A FilterResponseEvent instance
   */
  public function onKernelResponse(FilterResponseEvent $event) {
    if (!$event
      ->isMasterRequest()) {
      return;
    }
    $response = $event
      ->getResponse();
    if ($response instanceof StreamedResponse) {
      $response
        ->send();
    }
  }
  public static function getSubscribedEvents() {
    return array(
      KernelEvents::RESPONSE => array(
        'onKernelResponse',
        -1024,
      ),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
StreamedResponseListener::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. Overrides EventSubscriberInterface::getSubscribedEvents
StreamedResponseListener::onKernelResponse public function Filters the Response.