Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HttpFoundationFactory.php

function HttpFoundationFactory::createStreamedResponseCallback

1 call to HttpFoundationFactory::createStreamedResponseCallback()
HttpFoundationFactory::createResponse in vendor/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php
Creates a Symfony Response instance from a PSR-7 one.

File

vendor/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php, line 138

Class

HttpFoundationFactory
@author Kévin Dunglas <dunglas@gmail.com>

Namespace

Symfony\Bridge\PsrHttpMessage\Factory

Code

private function createStreamedResponseCallback(StreamInterface $body) : callable {
    return function () use ($body) {
        if ($body->isSeekable()) {
            $body->rewind();
        }
        if (!$body->isReadable()) {
            echo $body;
            return;
        }
        while (!$body->eof()) {
            echo $body->read($this->responseBufferMaxLength);
        }
    };
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal