Force output buffers to be flushed, if they're turned on.

If output buffering is turned on, PHP can be a bit slack about sending
the data to the client before closing the connection with exit(). These
changes ensure we call ob_flush() before we leave.  We call @ob_flush()
so we don't get noisy warnings when output buffering is off...
This commit is contained in:
Andrew McMillan committed 2011-11-02 18:43:10 +13:00
1 parent c093419591
commit b50b2d82ea
13 files changed
+24 -23

No files matched your search

+3 -2
View File
@@ -26,6 +26,7 @@ function early_exception_handler($e) {
foreach( $trace AS $k => $v ) {
printf( "%s[%d] %s%s%s()\n", $v['file'], $v['line'], (isset($v['class'])?$v['class']:''), (isset($v['type'])?$v['type']:''), (isset($v['function'])?$v['function']:'') );
}
@ob_flush();
}
set_exception_handler('early_exception_handler');
@@ -89,7 +90,7 @@ if ( ! @include_once('AWLUtilities.php') ) {
}
if ( ! @include_once('AWLUtilities.php') ) {
echo "Could not find the AWL libraries. Are they installed? Check your include_path in php.ini!\n";
exit;
@ob_flush(); exit(0);
}
}
@@ -145,7 +146,7 @@ else if ( @file_exists('config/config.php') ) {
}
else {
include('davical_configuration_missing.php');
exit;
@ob_flush(); exit(0);
}
$config_warnings = trim(ob_get_contents());
ob_end_clean();