Translated using Weblate (Estonian)
[phpmyadmin.git] / server_status_variables.php
blobe8dc61e6f7127fb0a924e55b8ff2a1fed403d651
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 */
8 declare(strict_types=1);
10 use PhpMyAdmin\Response;
11 use PhpMyAdmin\Message;
12 use PhpMyAdmin\Server\Status\Data;
13 use PhpMyAdmin\Server\Status\Variables;
15 require_once 'libraries/common.inc.php';
16 require_once 'libraries/server_common.inc.php';
17 require_once 'libraries/replication.inc.php';
19 /**
20 * flush status variables if requested
22 if (isset($_REQUEST['flush'])) {
23 $_flush_commands = [
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 Data();
37 $response = Response::getInstance();
38 $header = $response->getHeader();
39 $scripts = $header->getScripts();
40 $scripts->addFile('server_status_variables.js');
41 $scripts->addFile('vendor/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(Variables::getHtmlForFilter($serverStatusData));
48 $response->addHTML(Variables::getHtmlForLinkSuggestions($serverStatusData));
49 $response->addHTML(Variables::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;