get rid of warnings and present explicit messages
[phpmyadmin/dennischen.git] / server_variables.php
blob68621779c8e79758dd96a9997c6fc41821f74991
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package phpMyAdmin
6 */
8 /**
9 * no need for variables importing
10 * @ignore
12 if (! defined('PMA_NO_VARIABLES_IMPORT')) {
13 define('PMA_NO_VARIABLES_IMPORT', true);
15 require_once './libraries/common.inc.php';
17 /**
18 * Does the common work
20 require './libraries/server_common.inc.php';
23 /**
24 * Displays the links
26 require './libraries/server_links.inc.php';
29 /**
30 * Displays the sub-page heading
32 echo '<h2>' . "\n"
33 . ($cfg['MainPageIconic'] ? '<img class="icon" src="' . $pmaThemeImage . 's_vars.png" width="16" height="16" alt="" />' : '')
34 . '' . __('Server variables and settings') . "\n"
35 . PMA_showMySQLDocu('server_system_variables','server_system_variables')
36 . '</h2>' . "\n";
39 /**
40 * Sends the queries and buffers the results
42 $serverVars = PMA_DBI_fetch_result('SHOW SESSION VARIABLES;', 0, 1);
43 $serverVarsGlobal = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES;', 0, 1);
44 $serverVarsDetails = PMA_DBI_fetch_result('SELECT * from phpmyadmin.pma_server_variables;', 'var_name');
46 /**
47 * Displays the page
50 <table class="data">
51 <thead>
52 <tr><th><?php echo __('Variable'); ?></th>
53 <th>
54 <?php
55 echo __('Session value') . ' / ' . __('Global value');
57 </th>
58 </tr>
59 </thead>
60 <tbody>
61 <?php
62 $odd_row = true;
63 foreach ($serverVars as $name => $value) {
65 <tr class="<?php
66 echo $odd_row ? 'odd' : 'even';
67 if ($serverVarsGlobal[$name] !== $value) {
68 echo ' marked';
70 ?>">
71 <th nowrap="nowrap">
73 <?php
74 $hasDetail=isset($serverVarsDetails[$name]);
75 echo $hasDetail?
76 "<a target=\"_blank\" href=\"{$serverVarsDetails[$name]["var_link"]}\"title=\"{$serverVarsDetails[$name]["var_desc"]}\">":
77 "";
78 echo htmlspecialchars(str_replace('_', ' ', $name));
79 echo $hasDetail?"</a>":"";
82 </th>
83 <td class="value"><?php
84 if (strlen($value) < 16 && is_numeric($value)) {
85 echo PMA_formatNumber($value, 0);
86 $is_numeric = true;
87 } else {
88 echo htmlspecialchars($value);
89 $is_numeric = false;
91 ?></td>
92 <?php
93 if ($serverVarsGlobal[$name] !== $value) {
95 </tr>
96 <tr class="<?php
97 echo $odd_row ? 'odd' : 'even';
98 ?> marked">
99 <td>(<?php echo __('Global value'); ?>)</td>
100 <td class="value"><?php
101 if ($is_numeric) {
102 echo PMA_formatNumber($serverVarsGlobal[$name], 0);
103 } else {
104 echo htmlspecialchars($serverVarsGlobal[$name]);
106 ?></td>
107 <?php } ?>
108 </tr>
109 <?php
110 $odd_row = !$odd_row;
113 </tbody>
114 </table>
115 <script>
116 $("table.data a[title]").qtip({ style: { name: 'cream', tip: true } });
117 </script>
118 <?php
122 * Sends the footer
124 require './libraries/footer.inc.php';