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

Breadcrumb

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

function Response::closeOutputBuffers

Cleans or flushes output buffers up to target level.

Resulting level can be greater than target level if a non-removable buffer has been encountered.

@final

3 calls to Response::closeOutputBuffers()
HtmlErrorRenderer::getAndCleanOutputBuffer in vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php
InlineFragmentRenderer::render in vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php
Additional available options:
Response::send in vendor/symfony/http-foundation/Response.php
Sends HTTP headers and content.

File

vendor/symfony/http-foundation/Response.php, line 1269

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public static function closeOutputBuffers(int $targetLevel, bool $flush) : void {
    $status = ob_get_status(true);
    $level = \count($status);
    $flags = \PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? \PHP_OUTPUT_HANDLER_FLUSHABLE : \PHP_OUTPUT_HANDLER_CLEANABLE);
    while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || ($s['flags'] & $flags) === $flags : $s['del'])) {
        if ($flush) {
            ob_end_flush();
        }
        else {
            ob_end_clean();
        }
    }
}
RSS feed
Powered by Drupal