Merge remote branch 'pootle/master'
[phpmyadmin-themes.git] / server_variables.php
blob4616395ac84e02cc75969c9a0d2cfd7215fd1f00
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 . '</h2>' . "\n";
38 /**
39 * Sends the queries and buffers the results
41 $serverVars = PMA_DBI_fetch_result('SHOW SESSION VARIABLES;', 0, 1);
42 $serverVarsGlobal = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES;', 0, 1);
45 /**
46 * Displays the page
49 <table class="data">
50 <thead>
51 <tr><th><?php echo __('Variable'); ?></th>
52 <th>
53 <?php
54 echo __('Session value') . ' / ' . __('Global value');
56 </th>
57 </tr>
58 </thead>
59 <tbody>
60 <?php
61 $odd_row = true;
62 foreach ($serverVars as $name => $value) {
64 <tr class="<?php
65 echo $odd_row ? 'odd' : 'even';
66 if ($serverVarsGlobal[$name] !== $value) {
67 echo ' marked';
69 ?>">
70 <th nowrap="nowrap">
71 <?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?></th>
72 <td class="value"><?php
73 if (strlen($value) < 16 && is_numeric($value)) {
74 echo PMA_formatNumber($value, 0);
75 $is_numeric = true;
76 } else {
77 echo htmlspecialchars($value);
78 $is_numeric = false;
80 ?></td>
81 <?php
82 if ($serverVarsGlobal[$name] !== $value) {
84 </tr>
85 <tr class="<?php
86 echo $odd_row ? 'odd' : 'even';
87 ?> marked">
88 <td>(<?php echo __('Global value'); ?>)</td>
89 <td class="value"><?php
90 if ($is_numeric) {
91 echo PMA_formatNumber($serverVarsGlobal[$name], 0);
92 } else {
93 echo htmlspecialchars($serverVarsGlobal[$name]);
95 ?></td>
96 <?php } ?>
97 </tr>
98 <?php
99 $odd_row = !$odd_row;
102 </tbody>
103 </table>
104 <?php
108 * Sends the footer
110 require './libraries/footer.inc.php';