예제 #1
0
 /**
  * Sends an HTML response to the browser
  *
  * @static
  * @return void
  */
 public static function response()
 {
     $response = PMA_Response::getInstance();
     chdir($response->getCWD());
     $buffer = PMA_OutputBuffering::getInstance();
     if (empty($response->_HTML)) {
         $response->_HTML = $buffer->getContents();
     }
     if ($response->isAjax()) {
         $response->_ajaxResponse();
     } else {
         $response->_htmlResponse();
     }
     $buffer->flush();
     exit;
 }
 *
 * @package PhpMyAdmin
 */
chdir('..');
// Send correct type:
header('Content-Type: text/javascript; charset=UTF-8');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
// Avoid loading the full common.inc.php because this would add many
// non-js-compatible stuff like DOCTYPE
define('PMA_MINIMUM_COMMON', true);
require_once './libraries/common.inc.php';
require_once './libraries/OutputBuffering.class.php';
$buffer = PMA_OutputBuffering::getInstance();
$buffer->start();
register_shutdown_function(function () {
    echo PMA_OutputBuffering::getInstance()->getContents();
});
// Get the data for the sprites, if it's available
if (is_readable($_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php')) {
    include $_SESSION['PMA_Theme']->getPath() . '/sprites.lib.php';
}
$sprites = array();
if (function_exists('PMA_sprites')) {
    $sprites = PMA_sprites();
}
// We only need the keys from the array of sprites data,
// since they contain the (partial) class names
$keys = array();
foreach ($sprites as $key => $value) {
    $keys[] = "'{$key}'";
}
 /**
  * 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.
  *
  * @return void
  */
 public static function stop()
 {
     $buffer = PMA_OutputBuffering::getInstance();
     if ($buffer->_on) {
         $buffer->_on = false;
         $buffer->_content = ob_get_contents();
         ob_end_clean();
     }
     PMA_Response::response();
 }