Seems that change to output buffer flushing is problematic with zlib.

This commit is contained in:
Andrew McMillan 2012-06-14 13:36:15 +12:00
parent d1c2179bbb
commit 2538835a12
4 changed files with 17 additions and 4 deletions

View File

@ -26,7 +26,10 @@ function early_exception_handler($e) {
echo "<pre>\n";
// Too late to set resultcode :-(
}
while ( ob_get_level() > 0 ) ob_end_flush();
try {
@ob_flush(); // Seems like it should be better to do the following but is problematic on PHP5.3 at least: while ( ob_get_level() > 0 ) ob_end_flush();
}
catch( Exception $ignored ) {}
echo "Exception [".$e->getCode()."] ".$e->getmessage()."\n";
echo "At line ", $e->getLine(), " of ", $e->getFile(), "\n";
echo "================= Stack Trace ===================\n";

View File

@ -30,7 +30,10 @@ function catch_setup_errors($errno , $errstr , $errfile , $errline , $errcontext
return true;
}
if ( !headers_sent() ) header("Content-type: text/plain"); else echo "<pre>\n";
while ( ob_get_level() > 0 ) ob_end_flush();
try {
@ob_flush(); // Seems like it should be better to do the following but is problematic on PHP5.3 at least: while ( ob_get_level() > 0 ) ob_end_flush();
}
catch( Exception $ignored ) {}
echo "Error [".$errno."] ".$errstr."\n";
echo "At line ", $errline, " of ", $errfile, "\n";

View File

@ -1294,7 +1294,11 @@ EOSQL;
@dbg_error_log("statistics", "Method: %s, Status: %d, Script: %5.3lfs, Queries: %5.3lfs, URL: %s",
$this->method, $status, $script_time, $c->total_query_time, $this->path);
}
while ( ob_get_level() > 0 ) ob_end_flush();
try {
@ob_flush(); // Seems like it should be better to do the following but is problematic on PHP5.3 at least: while ( ob_get_level() > 0 ) ob_end_flush();
}
catch( Exception $ignored ) {}
exit(0);
}

View File

@ -26,7 +26,10 @@ function early_exception_handler($e) {
echo "<pre>\n";
// Too late to set resultcode :-(
}
while ( ob_get_level() > 0 ) ob_end_flush();
try {
@ob_flush(); // Seems like it should be better to do the following but is problematic on PHP5.3 at least: while ( ob_get_level() > 0 ) ob_end_flush();
}
catch( Exception $ignored ) {}
echo "Exception [".$e->getCode()."] ".$e->getmessage()."\n";
echo "At line ", $e->getLine(), " of ", $e->getFile(), "\n";
echo "================= Stack Trace ===================\n";