File: server_variables.php

package info (click to toggle)
phpmyadmin 4%3A2.6.2-3sarge6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 10,240 kB
  • ctags: 91,384
  • sloc: php: 115,860; sh: 557; sql: 224; perl: 4
file content (123 lines) | stat: -rw-r--r-- 2,935 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
/* $Id: server_variables.php,v 2.7 2004/08/12 15:13:19 nijel Exp $ */
// vim: expandtab sw=4 ts=4 sts=4:


/**
 * Does the common work
 */
require('./server_common.inc.php');


/**
 * Displays the links
 */
require('./server_links.inc.php');


/**
 * Displays the sub-page heading
 */
echo '<h2>' . "\n"
   . ($cfg['MainPageIconic'] ? '<img src="' . $pmaThemeImage . 's_vars.png" width="16" height="16" border="0" hspace="2" align="middle" />' : '' )
   . '' . $strServerVars . "\n"
   . '</h2>' . "\n";


/**
 * Checks if the user is allowed to do what he tries to...
 */
if (!$is_superuser && !$cfg['ShowMysqlVars']) {
    echo $strNoPrivileges;
    require_once('./footer.inc.php');
}


/**
 * Sends the queries and buffers the results
 */
if (PMA_MYSQL_INT_VERSION >= 40003) {
    $res = PMA_DBI_query('SHOW SESSION VARIABLES;');
    while ($row = PMA_DBI_fetch_row($res)) {
        $serverVars[$row[0]] = $row[1];
    }
    PMA_DBI_free_result($res);
    unset($res, $row);
    $res = PMA_DBI_query('SHOW GLOBAL VARIABLES;');
    while ($row = PMA_DBI_fetch_row($res)) {
        $serverVarsGlobal[$row[0]] = $row[1];
    }
    PMA_DBI_free_result($res);
    unset($res, $row);
} else {
    $res = PMA_DBI_query('SHOW VARIABLES;');
    while ($row = PMA_DBI_fetch_row($res)) {
        $serverVars[$row[0]] = $row[1];
    }
    PMA_DBI_free_result($res);
    unset($res, $row);
}
unset($res);
unset($row);


/**
 * Displays the page
 */
?>
<table border="0" cellpadding="2" cellspacing="1" width="90%">
    <tr>
        <th>&nbsp;<?php echo $strVar; ?>&nbsp;</th>
<?php
echo '        <th>&nbsp;';
if (PMA_MYSQL_INT_VERSION >= 40003) {
    echo $strSessionValue . '&nbsp;</th>' . "\n"
       . '        <th>&nbsp;' . $strGlobalValue;
} else {
    echo $strValue;
}
echo '&nbsp;</th>' . "\n";
?>
    </tr>
<?php
$useBgcolorOne = TRUE;
$on_mouse='';
foreach ($serverVars as $name => $value) {
        if ($GLOBALS['cfg']['BrowsePointerEnable'] == TRUE) {
            $on_mouse = ' onmouseover="this.style.backgroundColor=\'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\';"'
                      . ' onmouseout="this.style.backgroundColor=\'' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '\';"';
        } else {
            $on_mouse = '';
        }
?>
    <tr bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"<?php echo $on_mouse; ?>>
        <td nowrap="nowrap" valign="top">
            <b><?php echo htmlspecialchars(str_replace('_', ' ', $name)) . "\n"; ?></b>
        </td>
        <td>
            <?php echo htmlspecialchars($value) . "\n"; ?>
        </td>
<?php
    if (PMA_MYSQL_INT_VERSION >= 40003) {
?>
        <td>
            <?php echo htmlspecialchars($serverVarsGlobal[$name]) . "\n"; ?>
        </td>
<?php
    }
    $useBgcolorOne = !$useBgcolorOne;
?>
    </tr>
<?php
}
?>
</table>
<?php


/**
 * Sends the footer
 */
require_once('./footer.inc.php');

?>