Translated using Weblate (Czech)
[phpmyadmin.git] / server_status_variables.php
blob368d979f1a2e36db92ec03464017ed9ec9df7fce
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 PhpMyAdmin\Response;
10 use PhpMyAdmin\Message;
11 use PhpMyAdmin\Server\Status\Data;
12 use PhpMyAdmin\Server\Status\Variables;
14 require_once 'libraries/common.inc.php';
15 require_once 'libraries/server_common.inc.php';
16 require_once 'libraries/replication.inc.php';
18 /**
19 * flush status variables if requested
21 if (isset($_POST['flush'])) {
22 $_flush_commands = array(
23 'STATUS',
24 'TABLES',
25 'QUERY CACHE',
28 if (in_array($_POST['flush'], $_flush_commands)) {
29 $GLOBALS['dbi']->query('FLUSH ' . $_POST['flush'] . ';');
31 unset($_flush_commands);
34 $serverStatusData = new Data();
36 $response = Response::getInstance();
37 $header = $response->getHeader();
38 $scripts = $header->getScripts();
39 $scripts->addFile('server_status_variables.js');
40 $scripts->addFile('vendor/jquery/jquery.tablesorter.js');
41 $scripts->addFile('server_status_sorter.js');
43 $response->addHTML('<div>');
44 $response->addHTML($serverStatusData->getMenuHtml());
45 if ($serverStatusData->dataLoaded) {
46 $response->addHTML(Variables::getHtmlForFilter($serverStatusData));
47 $response->addHTML(Variables::getHtmlForLinkSuggestions($serverStatusData));
48 $response->addHTML(Variables::getHtmlForVariablesList($serverStatusData));
49 } else {
50 $response->addHTML(
51 Message::error(
52 __('Not enough privilege to view status variables.')
53 )->getDisplay()
56 $response->addHTML('</div>');
58 exit;