Rev Author Line No. Line
250 kaklik 1 <?php
2 /* $Id: server_variables.php,v 2.13 2005/12/07 12:57:07 cybot_tm Exp $ */
3 // vim: expandtab sw=4 ts=4 sts=4:
4  
5 if ( ! defined( 'PMA_NO_VARIABLES_IMPORT' ) ) {
6 define( 'PMA_NO_VARIABLES_IMPORT', true );
7 }
8 require_once('./libraries/common.lib.php');
9  
10 /**
11 * Does the common work
12 */
13 require('./libraries/server_common.inc.php');
14  
15  
16 /**
17 * Displays the links
18 */
19 require('./libraries/server_links.inc.php');
20  
21  
22 /**
23 * Displays the sub-page heading
24 */
25 echo '<h2>' . "\n"
26 . ($cfg['MainPageIconic'] ? '<img class="icon" src="' . $pmaThemeImage . 's_vars.png" width="16" height="16" alt="" />' : '' )
27 . '' . $strServerVars . "\n"
28 . '</h2>' . "\n";
29  
30  
31 /**
32 * Sends the queries and buffers the results
33 */
34 if (PMA_MYSQL_INT_VERSION >= 40003) {
35 $serverVars = PMA_DBI_fetch_result('SHOW SESSION VARIABLES;', 0, 1);
36 $serverVarsGlobal = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES;', 0, 1);
37 } else {
38 $serverVars = PMA_DBI_fetch_result('SHOW VARIABLES;', 0, 1);
39 }
40  
41  
42 /**
43 * Displays the page
44 */
45 ?>
46 <table class="data">
47 <thead>
48 <tr><th><?php echo $strVar; ?></th>
49 <th>
50 <?php
51 if (PMA_MYSQL_INT_VERSION >= 40003) {
52 echo $strSessionValue . ' / ' . $strGlobalValue;
53 } else {
54 echo $strValue;
55 }
56 ?>
57 </th>
58 </tr>
59 </thead>
60 <tbody>
61 <?php
62 $odd_row = true;
63 $useBgcolorOne = TRUE;
64 foreach ($serverVars as $name => $value) {
65 ?>
66 <tr class="<?php
67 echo $odd_row ? 'odd' : 'even';
68 if (PMA_MYSQL_INT_VERSION >= 40003
69 && $serverVarsGlobal[$name] !== $value ) {
70 echo ' marked';
71 }
72 ?>">
73 <th nowrap="nowrap">
74 <?php echo htmlspecialchars(str_replace('_', ' ', $name)); ?></th>
75 <td class="value"><?php
76 if ( is_numeric($value) ) {
77 echo PMA_formatNumber($value, 0);
78 $is_numeric = true;
79 } else {
80 echo htmlspecialchars($value);
81 $is_numeric = false;
82 }
83 ?></td>
84 <?php
85 if (PMA_MYSQL_INT_VERSION >= 40003
86 && $serverVarsGlobal[$name] !== $value ) {
87 ?>
88 </tr>
89 <tr class="<?php
90 echo $odd_row ? 'odd' : 'even';
91 ?> marked">
92 <td>(<?php echo $strGlobalValue; ?>)</td>
93 <td class="value"><?php
94 if ( $is_numeric ) {
95 echo PMA_formatNumber($serverVarsGlobal[$name], 0);
96 } else {
97 echo htmlspecialchars($serverVarsGlobal[$name]);
98 }
99 ?></td>
100 <?php } ?>
101 </tr>
102 <?php
103 $odd_row = !$odd_row;
104 }
105 ?>
106 </tbody>
107 </table>
108 <?php
109  
110  
111 /**
112 * Sends the footer
113 */
114 require_once('./libraries/footer.inc.php');
115  
116 ?>