Merge remote-tracking branch 'origin/master'
[phpmyadmin.git] / server_status_variables.php
blob2038dc5c4274958e3a44e9b3f98002188c5cefab
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Displays a list of server status variables
6 * @package PhpMyAdmin
7 */
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/server_common.inc.php';
11 require_once 'libraries/ServerStatusData.class.php';
12 require_once 'libraries/server_status_variables.lib.php';
14 if (PMA_DRIZZLE) {
15 $GLOBALS['replication_info'] = array();
16 $GLOBALS['replication_info']['master']['status'] = false;
17 $GLOBALS['replication_info']['slave']['status'] = false;
18 } else {
19 include_once 'libraries/replication.inc.php';
20 include_once 'libraries/replication_gui.lib.php';
23 /**
24 * flush status variables if requested
26 if (isset($_REQUEST['flush'])) {
27 $_flush_commands = array(
28 'STATUS',
29 'TABLES',
30 'QUERY CACHE',
33 if (in_array($_REQUEST['flush'], $_flush_commands)) {
34 $GLOBALS['dbi']->query('FLUSH ' . $_REQUEST['flush'] . ';');
36 unset($_flush_commands);
39 $ServerStatusData = new PMA_ServerStatusData();
41 $response = PMA_Response::getInstance();
42 $header = $response->getHeader();
43 $scripts = $header->getScripts();
44 $scripts->addFile('server_status_variables.js');
45 $scripts->addFile('jquery/jquery.tablesorter.js');
46 $scripts->addFile('server_status_sorter.js');
48 $response->addHTML('<div>');
49 $response->addHTML($ServerStatusData->getMenuHtml());
50 $response->addHTML(PMA_getHtmlForFilter($ServerStatusData));
51 $response->addHTML(PMA_getHtmlForLinkSuggestions($ServerStatusData));
52 $response->addHTML(PMA_getHtmlForVariablesList($ServerStatusData));
53 $response->addHTML('</div>');
55 exit;