applied coding standards
This commit is contained in:
@@ -6,56 +6,65 @@ if (!defined('__OB_LIB__')) {
|
|||||||
define('__OB_LIB__', 1);
|
define('__OB_LIB__', 1);
|
||||||
|
|
||||||
# Output buffer functions for phpMyAdmin
|
# Output buffer functions for phpMyAdmin
|
||||||
|
#
|
||||||
# Copyright 2001 Jeremy Brand <jeremy@nirvani.net>
|
# Copyright 2001 Jeremy Brand <jeremy@nirvani.net>
|
||||||
# http://www.jeremybrand.com/Jeremy/Brand/Jeremy_Brand.html
|
# http://www.jeremybrand.com/Jeremy/Brand/Jeremy_Brand.html
|
||||||
|
#
|
||||||
# Check for all the needed functions for output buffering
|
# Check for all the needed functions for output buffering
|
||||||
# Make some wrappers for the top and bottoms of our files.
|
# Make some wrappers for the top and bottoms of our files.
|
||||||
|
|
||||||
function out_buffer_mode_get()
|
|
||||||
# This will be used eventually to support more modes. It is
|
|
||||||
# needed because both header and footer functions must know
|
|
||||||
# what each other is doing.
|
|
||||||
{
|
|
||||||
if (@function_exists('ob_start'))
|
|
||||||
$mode = 1;
|
|
||||||
else
|
|
||||||
$mode = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If a user sets the output_handler in php.ini to ob_gzhandler, then
|
* This function be used eventually to support more modes. It is needed
|
||||||
* any right frame file in phpMyAdmin will not be handled properly by the
|
* because both header and footer functions must know what each other is
|
||||||
* browser. My fix was to check the ini file within the
|
* doing.
|
||||||
* out_buffer_mode_get() function.
|
|
||||||
*
|
*
|
||||||
* (Patch by Garth Gillespie, modified by Marc Delisle)
|
* @return integer the output buffer mode
|
||||||
*/
|
*/
|
||||||
if (@function_exists('ini_get')) {
|
function out_buffer_mode_get()
|
||||||
|
{
|
||||||
|
if (PHP_INT_VERSION >= 40000 && @function_exists('ob_start')) {
|
||||||
|
$mode = 1;
|
||||||
|
} else {
|
||||||
|
$mode = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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
|
||||||
|
// out_buffer_mode_get() function.
|
||||||
|
//
|
||||||
|
// (Patch by Garth Gillespie, modified by Marc Delisle)
|
||||||
|
if (PHP_INT_VERSION >= 40000 && @ini_get('output_handler')) {
|
||||||
if (@ini_get('output_handler') == 'ob_gzhandler') {
|
if (@ini_get('output_handler') == 'ob_gzhandler') {
|
||||||
$mode = 0;
|
$mode = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (PHP_INT_VERSION >= 40000) {
|
||||||
if (@get_cfg_var('output_handler') == 'ob_gzhandler') {
|
if (@get_cfg_var('output_handler') == 'ob_gzhandler') {
|
||||||
$mode = 0;
|
$mode = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End patch
|
// End patch
|
||||||
|
|
||||||
# Zero (0) is no mode or in other words output buffering is OFF.
|
// 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.
|
||||||
|
|
||||||
# Follow 2^0, 2^1, 2^2, 2^3 type values for the modes.
|
header('X-ob_mode: ' . $mode);
|
||||||
# Usefull if we ever decide to combine modes. Then a bitmask
|
|
||||||
# field of the sum of all modes will be the natural choice.
|
|
||||||
|
|
||||||
header("X-ob_mode: $mode");
|
|
||||||
|
|
||||||
return $mode;
|
return $mode;
|
||||||
}
|
} // end of the 'out_buffer_mode_get()' function
|
||||||
|
|
||||||
# This function will need to run at the top of all pages if
|
|
||||||
# output buffering is turned on. It also needs to be passed $mode
|
/**
|
||||||
# from the out_buffer_mode_get() function or it will be useless.
|
* 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 out_buffer_mode_get() function or it will be useless.
|
||||||
|
*
|
||||||
|
* @param integer the output buffer mode
|
||||||
|
*
|
||||||
|
* @return boolean whether output buffering is enabled or not
|
||||||
|
*/
|
||||||
function out_buffer_pre($mode)
|
function out_buffer_pre($mode)
|
||||||
{
|
{
|
||||||
switch($mode)
|
switch($mode)
|
||||||
@@ -73,13 +82,21 @@ if (!defined('__OB_LIB__')) {
|
|||||||
default:
|
default:
|
||||||
$retval = FALSE;
|
$retval = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
} // end switch
|
||||||
return $retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
# This function will need to run at the bottom of all pages if
|
return $retval;
|
||||||
# output buffering is turned on. It also needs to be passed $mode
|
} // end of the 'out_buffer_pre()' function
|
||||||
# from the out_buffer_mode_get() function or it will be useless.
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
* out_buffer_mode_get() function or it will be useless.
|
||||||
|
*
|
||||||
|
* @param integer the output buffer mode
|
||||||
|
*
|
||||||
|
* @return boolean whether data has been send from the buffer or not
|
||||||
|
*/
|
||||||
function out_buffer_post($mode)
|
function out_buffer_post($mode)
|
||||||
{
|
{
|
||||||
switch($mode)
|
switch($mode)
|
||||||
@@ -91,13 +108,16 @@ if (!defined('__OB_LIB__')) {
|
|||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
$retval = FALSE;
|
$retval = FALSE;
|
||||||
|
break;
|
||||||
|
|
||||||
// loic1: php3 fix
|
// loic1: php3 fix
|
||||||
default:
|
default:
|
||||||
$retval = FALSE;
|
$retval = FALSE;
|
||||||
}
|
break;
|
||||||
|
} // end switch
|
||||||
|
|
||||||
return $retval;
|
return $retval;
|
||||||
}
|
} // end of the 'out_buffer_post()' function
|
||||||
|
|
||||||
} // $__OB_LIB__
|
} // $__OB_LIB__
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user