3

If I use $response->send() then this code is executed:

public static function closeOutputBuffers($targetLevel, $flush)
    {
        $status = ob_get_status(true);
        $level = count($status);
        // PHP_OUTPUT_HANDLER_* are not defined on HHVM 3.3
        $flags = defined('PHP_OUTPUT_HANDLER_REMOVABLE') ? PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE) : -1;

        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();
            }
        }
    }

But there is none in the whole class ob_start etc...

What is the other way to add something to ob and show this by ob_end_flush?

How it work in this code?

In variable $status is:

array (size=1)
  0 => 
    array (size=7)
      'name' => string 'default output handler' (length=22)
      'type' => int 0
      'flags' => int 112
      'level' => int 0
      'chunk_size' => int 4096
      'buffer_size' => int 8192
      'buffer_used' => int 8

But I can't find "default output handler" in whole package from http-foundation. Why?

hapeb
  • 33
  • 2
  • Check you php.ini for the value of the [output_buffering](http://php.net/manual/en/outcontrol.configuration.php) setting. – apokryfos Jan 28 '18 at 17:57
  • Pretty sure that in most cases the ob routines are not called. The close output buffer is only for the unusual case where buffers are used. The level = 0 in the status variable confirms that no output buffering is being used. – Cerad Jan 28 '18 at 18:13

0 Answers0