2 /* vim: set expandtab sw=4 ts=4 sts=4: */
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/server_variables.lib.php';
12 $response = PMA_Response
::getInstance();
13 $header = $response->getHeader();
14 $scripts = $header->getScripts();
15 $scripts->addFile('server_variables.js');
18 * Does the common work
20 require 'libraries/server_common.inc.php';
23 * Array of documentation links
25 $variable_doc_links = PMA_getArrayForDocumentLinks();
31 if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
32 if (isset($_REQUEST['type'])) {
33 if ($_REQUEST['type'] === 'getval') {
34 PMA_getAjaxReturnForGetVal($variable_doc_links);
35 } else if ($_REQUEST['type'] === 'setval') {
36 PMA_getAjaxReturnForSetVal($variable_doc_links);
43 * Displays the sub-page heading
45 $doc_link = PMA_Util
::showMySQLDocu('server_system_variables');
46 $response->addHtml(PMA_getHtmlForSubPageHeader('variables', $doc_link));
49 * Sends the queries and buffers the results
51 $serverVarsResult = $GLOBALS['dbi']->tryQuery('SHOW SESSION VARIABLES;');
53 if ($serverVarsResult !== false) {
55 $serverVarsSession = array();
56 while ($arr = $GLOBALS['dbi']->fetchRow($serverVarsResult)) {
57 $serverVarsSession[$arr[0]] = $arr[1];
59 $GLOBALS['dbi']->freeResult($serverVarsResult);
61 $serverVars = $GLOBALS['dbi']->fetchResult('SHOW GLOBAL VARIABLES;', 0, 1);
66 $response->addHtml(PMA_getHtmlForLinkTemplates());
72 PMA_getHtmlForServerVariables(
73 $variable_doc_links, $serverVars, $serverVarsSession
78 * Display the error message
83 __('Not enough privilege to view server variables and settings. %s'),
84 PMA_Util
::showMySQLDocu(
85 'server-system-variables',
87 'sysvar_show_compatibility_56'