Translated using Weblate (Thai)
[phpmyadmin.git] / server_status_advisor.php
blob29d5f5c39002937b0899286a64342adce615a322
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * displays the advisor feature
6 * @package PhpMyAdmin
7 */
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/Advisor.class.php';
11 require_once 'libraries/ServerStatusData.class.php';
12 if (PMA_DRIZZLE) {
13 $server_master_status = false;
14 $server_slave_status = false;
15 } else {
16 include_once 'libraries/replication.inc.php';
17 include_once 'libraries/replication_gui.lib.php';
20 $ServerStatusData = new PMA_ServerStatusData('server_status_advisor.php');
22 $response = PMA_Response::getInstance();
23 $scripts = $response->getHeader()->getScripts();
24 $scripts->addFile('server_status_advisor.js');
26 $output = '<div>';
27 $output .= $ServerStatusData->getMenuHtml();
28 $output .= '<a href="#openAdvisorInstructions">';
29 $output .= PMA_Util::getIcon('b_help.png', __('Instructions'));
30 $output .= '</a>';
31 $output .= '<div id="statustabs_advisor"></div>';
32 $output .= '<div id="advisorInstructionsDialog" style="display:none;">';
33 $output .= '<p>';
34 $output .= __(
35 'The Advisor system can provide recommendations '
36 . 'on server variables by analyzing the server status variables.'
38 $output .= '</p>';
39 $output .= '<p>';
40 $output .= __(
41 'Do note however that this system provides recommendations '
42 . 'based on simple calculations and by rule of thumb which may '
43 . 'not necessarily apply to your system.'
45 $output .= '</p>';
46 $output .= '<p>';
47 $output .= __(
48 'Prior to changing any of the configuration, be sure to know '
49 . 'what you are changing (by reading the documentation) and how '
50 . 'to undo the change. Wrong tuning can have a very negative '
51 . 'effect on performance.'
53 $output .= '</p>';
54 $output .= '<p>';
55 $output .= __(
56 'The best way to tune your system would be to change only one '
57 . 'setting at a time, observe or benchmark your database, and undo '
58 . 'the change if there was no clearly measurable improvement.'
60 $output .= '</p>';
61 $output .= '</div>';
62 $output .= '<div id="advisorData" style="display:none;">';
63 $advisor = new Advisor();
64 $output .= htmlspecialchars(
65 json_encode(
66 $advisor->run()
69 $output .= '</div>';
70 $output .= '</div>';
72 $response->addHTML($output);