diff options
-rw-r--r-- | browse_foreigners.php | 17 | ||||
-rw-r--r-- | libraries/footer.inc.php | 6 | ||||
-rw-r--r-- | libraries/header.inc.php | 7 | ||||
-rw-r--r-- | libraries/header_printview.inc.php | 7 | ||||
-rw-r--r-- | libraries/ob.lib.php | 54 | ||||
-rw-r--r-- | navigation.php | 8 | ||||
-rw-r--r-- | querywindow.php | 5 |
7 files changed, 21 insertions, 83 deletions
diff --git a/browse_foreigners.php b/browse_foreigners.php index ea981d7efe..4ea4bef50a 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -14,12 +14,8 @@ require_once('./libraries/common.inc.php'); PMA_checkParameters(array('db', 'table', 'field')); require_once('./libraries/ob.lib.php'); -if ($cfg['OBGzip']) { - $ob_mode = PMA_outBufferModeGet(); - if ($ob_mode) { - PMA_outBufferPre($ob_mode); - } -} +PMA_outBufferPre(); + require_once('./libraries/header_http.inc.php'); $field = urldecode($field); @@ -298,13 +294,4 @@ if (isset($controllink) && $controllink) { if (isset($userlink) && $userlink) { @PMA_DBI_close($userlink); } - - -/** - * Sends bufferized data - */ -if (isset($cfg['OBGzip']) && $cfg['OBGzip'] - && isset($ob_mode) && $ob_mode) { - PMA_outBufferPost($ob_mode); -} ?> diff --git a/libraries/footer.inc.php b/libraries/footer.inc.php index d17cf4ab18..93e0d2a64c 100644 --- a/libraries/footer.inc.php +++ b/libraries/footer.inc.php @@ -40,7 +40,6 @@ * @uses PMA_getenv() * @uses PMA_generate_common_url() * @uses PMA_DBI_close() - * @uses PMA_outBufferPost() * @uses basename() * @uses file_exists() * @version $Id$ @@ -190,11 +189,6 @@ if (! empty($GLOBALS['cfg']['DBG']['enable']) </html> <?php /** - * Sends bufferized data - */ -PMA_outBufferPost(); - -/** * Stops the script execution */ exit; diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 336c1c1abb..be24416330 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -17,12 +17,7 @@ if (empty($GLOBALS['is_header_sent'])) { */ require_once './libraries/common.inc.php'; require_once './libraries/ob.lib.php'; - if ($GLOBALS['cfg']['OBGzip']) { - $GLOBALS['ob_mode'] = PMA_outBufferModeGet(); - if ($GLOBALS['ob_mode']) { - PMA_outBufferPre($GLOBALS['ob_mode']); - } - } + PMA_outBufferPre(); // garvin: For re-usability, moved http-headers and stylesheets // to a seperate file. It can now be included by header.inc.php, diff --git a/libraries/header_printview.inc.php b/libraries/header_printview.inc.php index ca68b57e53..a766bbd03c 100644 --- a/libraries/header_printview.inc.php +++ b/libraries/header_printview.inc.php @@ -10,12 +10,7 @@ */ require_once('./libraries/common.inc.php'); require_once('./libraries/ob.lib.php'); -if ($cfg['OBGzip']) { - $ob_mode = PMA_outBufferModeGet(); - if ($ob_mode) { - PMA_outBufferPre($ob_mode); - } -} +PMA_outBufferPre(); // Check parameters diff --git a/libraries/ob.lib.php b/libraries/ob.lib.php index 99b8a8ac6f..3490d4e2bc 100644 --- a/libraries/ob.lib.php +++ b/libraries/ob.lib.php @@ -17,11 +17,10 @@ * because both header and footer functions must know what each other is * doing. * - * @uses $GLOBALS['cfg']['OBGzip'] + * @uses $cfg['OBGzip'] * @uses function_exists() * @uses ini_get() * @uses ob_get_level() - * @uses header() * @staticvar integer remember last calculated value * @return integer the output buffer mode */ @@ -60,8 +59,6 @@ function PMA_outBufferModeGet() // 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; } // end of the 'PMA_outBufferModeGet()' function @@ -72,26 +69,20 @@ function PMA_outBufferModeGet() * the PMA_outBufferModeGet() function or it will be useless. * * @uses PMA_outBufferModeGet() + * @uses PMA_outBufferPost() to register it as shutdown function * @uses ob_start() - * @param integer $mode DEPRECATED - * @return boolean whether output buffering is enabled or not + * @uses header() to send X-ob_mode: + * @uses register_shutdown_function() to register PMA_outBufferPost() */ -function PMA_outBufferPre($mode = null) +function PMA_outBufferPre() { - switch(PMA_outBufferModeGet()) - { - case 1: - ob_start('ob_gzhandler'); - $retval = true; - break; + if ($mode = PMA_outBufferModeGet()) { + ob_start('ob_gzhandler'); + } - case 0: - default: - $retval = false; - break; - } // end switch + header('X-ob_mode: ' . $mode); - return $retval; + register_shutdown_function('PMA_outBufferPost'); } // end of the 'PMA_outBufferPre()' function @@ -103,27 +94,14 @@ function PMA_outBufferPre($mode = null) * @uses PMA_outBufferModeGet() * @uses ob_flush() * @uses flush() - * @param integer $mode DEPRECATED - * @return boolean whether data has been send from the buffer or not */ -function PMA_outBufferPost($mode = null) +function PMA_outBufferPost() { - switch(PMA_outBufferModeGet()) - { - case 1: - # This output buffer doesn't need a footer. - ob_flush(); - $retval = true; - break; - - case 0: - default: - flush(); - $retval = false; - break; - } // end switch - - return $retval; + if (PMA_outBufferModeGet()) { + ob_flush(); + } else { + flush(); + } } // end of the 'PMA_outBufferPost()' function ?> diff --git a/navigation.php b/navigation.php index cb08a9b37c..8439e21581 100644 --- a/navigation.php +++ b/navigation.php @@ -52,7 +52,6 @@ require_once './libraries/common.inc.php'; * * @uses $GLOBALS['controllink'] to close it * @uses $GLOBALS['userlink'] to close it - * @uses PMA_outBufferPost() * @uses PMA_DBI_close() * @access private only to be used in navigation.php */ @@ -70,12 +69,7 @@ function PMA_exitNavigationFrame() @PMA_DBI_close($GLOBALS['userlink']); } - /** - * Sends bufferized data - */ - PMA_outBufferPost(); - - exit(); + exit; } // free the session file, for the other frames to be loaded diff --git a/querywindow.php b/querywindow.php index 95795648a3..2c0e6890dd 100644 --- a/querywindow.php +++ b/querywindow.php @@ -311,9 +311,4 @@ if (! empty($controllink)) { if (! empty($userlink)) { PMA_DBI_close($userlink); } - -/** - * Sends bufferized data - */ -PMA_outBufferPost(); ?> |