Files
@ 3be168914a12
Branch filter:
Location: DistRen/htdocs/sql/libraries/ob.lib.php - annotation
3be168914a12
3.3 KiB
text/x-php
Added web interface fileshg commit -h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 3be168914a12 | <?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Output buffer functions for phpMyAdmin
*
* Copyright 2001 Jeremy Brand <jeremy@nirvani.net>
* http://www.jeremybrand.com/Jeremy/Brand/Jeremy_Brand.html
*
* Check for all the needed functions for output buffering
* Make some wrappers for the top and bottoms of our files.
*
* @version $Id: ob.lib.php 10892 2007-11-01 20:48:43Z lem9 $
*/
/**
* This function be used eventually to support more modes. It is needed
* because both header and footer functions must know what each other is
* doing.
*
* @uses $cfg['OBGzip']
* @uses function_exists()
* @uses ini_get()
* @uses ob_get_level()
* @staticvar integer remember last calculated value
* @return integer the output buffer mode
*/
function PMA_outBufferModeGet()
{
static $mode = null;
if (null !== $mode) {
return $mode;
}
$mode = 0;
if ($GLOBALS['cfg']['OBGzip'] && function_exists('ob_start')) {
if (ini_get('output_handler') == 'ob_gzhandler') {
// If a user sets the output_handler in php.ini to ob_gzhandler, then
// any right frame file in phpMyAdmin will not be handled properly by
// the browser. My fix was to check the ini file within the
// PMA_outBufferModeGet() function.
//
// (Patch by Garth Gillespie, modified by Marc Delisle)
$mode = 0;
} elseif (function_exists('ob_get_level') && ob_get_level() > 0) {
// If output buffering is enabled in php.ini it's not possible to
// add the ob_gzhandler without a warning message from php 4.3.0.
// Being better safe than sorry, check for any existing output handler
// instead of just checking the 'output_buffering' setting.
$mode = 0;
} else {
$mode = 1;
}
}
// Zero (0) is no mode or in other words output buffering is OFF.
// Follow 2^0, 2^1, 2^2, 2^3 type values for the modes.
// Usefull if we ever decide to combine modes. Then a bitmask field of
// the sum of all modes will be the natural choice.
return $mode;
} // end of the 'PMA_outBufferModeGet()' function
/**
* This function will need to run at the top of all pages if output
* output buffering is turned on. It also needs to be passed $mode from
* the PMA_outBufferModeGet() function or it will be useless.
*
* @uses PMA_outBufferModeGet()
* @uses PMA_outBufferPost() to register it as shutdown function
* @uses ob_start()
* @uses header() to send X-ob_mode:
* @uses register_shutdown_function() to register PMA_outBufferPost()
*/
function PMA_outBufferPre()
{
if ($mode = PMA_outBufferModeGet()) {
ob_start('ob_gzhandler');
}
header('X-ob_mode: ' . $mode);
register_shutdown_function('PMA_outBufferPost');
} // end of the 'PMA_outBufferPre()' function
/**
* This function will need to run at the bottom of all pages if output
* buffering is turned on. It also needs to be passed $mode from the
* PMA_outBufferModeGet() function or it will be useless.
*
* @uses PMA_outBufferModeGet()
* @uses ob_flush()
* @uses flush()
*/
function PMA_outBufferPost()
{
if (ob_get_status() && PMA_outBufferModeGet()) {
ob_flush();
} else {
flush();
}
} // end of the 'PMA_outBufferPost()' function
?>
|