Migrated gritter to standardized package (#225)
[openemr.git] / phpmyadmin / server_status_variables.php
blob735cc3aea6e3cea4cefe2aa0d4cafebd01d10bb7
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 if ($serverStatusData->dataLoaded) {
51 $response->addHTML(PMA_getHtmlForFilter($serverStatusData));
52 $response->addHTML(PMA_getHtmlForLinkSuggestions($serverStatusData));
53 $response->addHTML(PMA_getHtmlForVariablesList($serverStatusData));
54 } else {
55 $response->addHTML(
56 PMA_Message::error(
57 __('Not enough privilege to view status variables.')
58 )->getDisplay()
61 $response->addHTML('</div>');
63 exit;