added missing support for the new output API in PHP 5.4+

This commit is contained in:
KUBO Atsuhiro 2013-08-08 15:11:48 +09:00 committed by Fabien Potencier
parent 484c7533bd
commit 1a73b44df0
1 changed files with 10 additions and 2 deletions

View File

@ -321,8 +321,16 @@ class Response
$obStatus = ob_get_status(1);
while (($level = ob_get_level()) > 0 && $level !== $previous) {
$previous = $level;
if ($obStatus[$level - 1] && isset($obStatus[$level - 1]['del']) && $obStatus[$level - 1]['del']) {
ob_end_flush();
if ($obStatus[$level - 1]) {
if (version_compare(PHP_VERSION, '5.4', '>=')) {
if (isset($obStatus[$level - 1]['flags']) && ($obStatus[$level - 1]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE)) {
ob_end_flush();
}
} else {
if (isset($obStatus[$level - 1]['del']) && $obStatus[$level - 1]['del']) {
ob_end_flush();
}
}
}
}
flush();