Documentation TYPO3 par Ameos |
00001 <?php 00002 /* $Id: ob.lib.php,v 2.2 2003/11/26 22:52:23 rabus Exp $ */ 00003 // vim: expandtab sw=4 ts=4 sts=4: 00004 00005 00023 function PMA_outBufferModeGet() 00024 { 00025 if (@function_exists('ob_start')) { 00026 $mode = 1; 00027 } else { 00028 $mode = 0; 00029 } 00030 00031 // If a user sets the output_handler in php.ini to ob_gzhandler, then 00032 // any right frame file in phpMyAdmin will not be handled properly by 00033 // the browser. My fix was to check the ini file within the 00034 // PMA_outBufferModeGet() function. 00035 // 00036 // (Patch by Garth Gillespie, modified by Marc Delisle) 00037 if (@ini_get('output_handler') == 'ob_gzhandler') { 00038 $mode = 0; 00039 } 00040 if (@get_cfg_var('output_handler') == 'ob_gzhandler') { 00041 $mode = 0; 00042 } 00043 // End patch 00044 00045 // If output buffering is enabled in php.ini it's not possible to 00046 // add the ob_gzhandler without a warning message from php 4.3.0. 00047 // Being better safe than sorry, check for any existing output handler 00048 // instead of just checking the 'output_buffering' setting. 00049 // 00050 if (@function_exists('ob_get_level')) { 00051 if (ob_get_level() > 0) { 00052 $mode = 0; 00053 } 00054 } 00055 00056 // Zero (0) is no mode or in other words output buffering is OFF. 00057 // Follow 2^0, 2^1, 2^2, 2^3 type values for the modes. 00058 // Usefull if we ever decide to combine modes. Then a bitmask field of 00059 // the sum of all modes will be the natural choice. 00060 00061 header('X-ob_mode: ' . $mode); 00062 00063 return $mode; 00064 } // end of the 'PMA_outBufferModeGet()' function 00065 00066 00076 function PMA_outBufferPre($mode) 00077 { 00078 switch($mode) 00079 { 00080 case 1: 00081 ob_start('ob_gzhandler'); 00082 $retval = TRUE; 00083 break; 00084 00085 case 0: 00086 $retval = FALSE; 00087 break; 00088 00089 // loic1: php3 fix 00090 default: 00091 $retval = FALSE; 00092 break; 00093 } // end switch 00094 00095 return $retval; 00096 } // end of the 'PMA_outBufferPre()' function 00097 00098 00108 function PMA_outBufferPost($mode) 00109 { 00110 switch($mode) 00111 { 00112 case 1: 00113 # This output buffer doesn't need a footer. 00114 $retval = TRUE; 00115 break; 00116 00117 case 0: 00118 $retval = FALSE; 00119 break; 00120 00121 // loic1: php3 fix 00122 default: 00123 $retval = FALSE; 00124 break; 00125 } // end switch 00126 00127 return $retval; 00128 } // end of the 'PMA_outBufferPost()' function 00129 00130 ?>