Translated using Weblate (Norwegian Bokmål)
[phpmyadmin.git] / server_status_variables.php
blobf5b41796070da61895c689f6ad3bcf6f2b234d4f
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 use PMA\libraries\Response;
10 use PMA\libraries\Message;
11 use PMA\libraries\ServerStatusData;
13 require_once 'libraries/common.inc.php';
14 require_once 'libraries/server_common.inc.php';
15 require_once 'libraries/server_status_variables.lib.php';
16 require_once 'libraries/replication.inc.php';
17 require_once 'libraries/replication_gui.lib.php';
19 /**
20 * flush status variables if requested
22 if (isset($_REQUEST['flush'])) {
23 $_flush_commands = array(
24 'STATUS',
25 'TABLES',
26 'QUERY CACHE',
29 if (in_array($_REQUEST['flush'], $_flush_commands)) {
30 $GLOBALS['dbi']->query('FLUSH ' . $_REQUEST['flush'] . ';');
32 unset($_flush_commands);
35 $serverStatusData = new ServerStatusData();
37 $response = Response::getInstance();
38 $header = $response->getHeader();
39 $scripts = $header->getScripts();
40 $scripts->addFile('server_status_variables.js');
41 $scripts->addFile('jquery/jquery.tablesorter.js');
42 $scripts->addFile('server_status_sorter.js');
44 $response->addHTML('<div>');
45 $response->addHTML($serverStatusData->getMenuHtml());
46 if ($serverStatusData->dataLoaded) {
47 $response->addHTML(PMA_getHtmlForFilter($serverStatusData));
48 $response->addHTML(PMA_getHtmlForLinkSuggestions($serverStatusData));
49 $response->addHTML(PMA_getHtmlForVariablesList($serverStatusData));
50 } else {
51 $response->addHTML(
52 Message::error(
53 __('Not enough privilege to view status variables.')
54 )->getDisplay()
57 $response->addHTML('</div>');
59 exit;