Removed some php 3 / MySQL 3.21 compatibility code.

This commit is contained in:
Alexander M. Turek
2003-11-20 21:50:37 +00:00
parent 6164918083
commit 3412621f5b
5 changed files with 14 additions and 10 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2003-11-20 Alexander M. Turek <rabus@users.sourceforge.net>
* server_databases.php, server_processlist.php, server_status.php,
server_variables.php: Removed some php 3 / MySQL 3.21 compatibility code.
2003-11-20 Michal Cihar <nijel@users.sourceforge.net> 2003-11-20 Michal Cihar <nijel@users.sourceforge.net>
* read_dump.php: Show message about failing upload in all cases, removed * read_dump.php: Show message about failing upload in all cases, removed
some PHP compatibility code. some PHP compatibility code.

View File

@@ -100,7 +100,7 @@ echo '<h2>' . "\n"
/** /**
* Checks if the user is allowed to do what he tries to... * Checks if the user is allowed to do what he tries to...
*/ */
if (!empty($dbstats) && (!$is_superuser || PMA_MYSQL_INT_VERSION < 32303)) { if (!empty($dbstats) && !$is_superuser) {
echo $strNoPrivileges . "\n"; echo $strNoPrivileges . "\n";
include('./footer.inc.php'); include('./footer.inc.php');
exit; exit;
@@ -221,15 +221,15 @@ if (count($statistics) > 0) {
'idx_sz' => 0, 'idx_sz' => 0,
'tot_sz' => 0 'tot_sz' => 0
); );
while (list(, $current) = each($statistics)) { foreach ($statistics as $current) {
list($data_size, $data_unit) = PMA_formatByteDown($current['data_sz'], 3, 1); list($data_size, $data_unit) = PMA_formatByteDown($current['data_sz'], 3, 1);
list($idx_size, $idx_unit) = PMA_formatByteDown($current['idx_sz'], 3, 1); list($idx_size, $idx_unit) = PMA_formatByteDown($current['idx_sz'], 3, 1);
list($tot_size, $tot_unit) = PMA_formatByteDown($current['tot_sz'], 3, 1); list($tot_size, $tot_unit) = PMA_formatByteDown($current['tot_sz'], 3, 1);
$total_calc['db_cnt']++; $total_calc['db_cnt']++;
$total_calc['tbl_cnt'] += $current['tbl_cnt']; $total_calc['tbl_cnt'] += $current['tbl_cnt'];
$total_calc['data_sz'] += $current['data_sz']; $total_calc['data_sz'] += $current['data_sz'];
$total_calc['idx_sz'] += $current['idx_sz']; $total_calc['idx_sz'] += $current['idx_sz'];
$total_calc['tot_sz'] += $current['tot_sz']; $total_calc['tot_sz'] += $current['tot_sz'];
echo ' <tr>' . "\n"; echo ' <tr>' . "\n";
if ($is_superuser || $cfg['AllowUserDropDatabase']) { if ($is_superuser || $cfg['AllowUserDropDatabase']) {
echo ' <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n" echo ' <td bgcolor="' . ($useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . "\n"
@@ -336,7 +336,7 @@ if (count($statistics) > 0) {
if ($is_superuser || $cfg['AllowUserDropDatabase']) { if ($is_superuser || $cfg['AllowUserDropDatabase']) {
echo ' <ul>' . "\n"; echo ' <ul>' . "\n";
} }
if ($is_superuser && empty($dbstats) && PMA_MYSQL_INT_VERSION >= 32303) { if ($is_superuser && empty($dbstats)) {
echo ' <li>' . "\n" echo ' <li>' . "\n"
. ' <b>' . "\n" . ' <b>' . "\n"
. ' <a href="./server_databases.php?' . $url_query . '&amp;dbstats=1" title="' . $strDatabasesStatsEnable . '">' . "\n" . ' <a href="./server_databases.php?' . $url_query . '&amp;dbstats=1" title="' . $strDatabasesStatsEnable . '">' . "\n"

View File

@@ -56,7 +56,7 @@ unset($row);
?> ?>
<table border="0"> <table border="0">
<tr> <tr>
<th><?php echo PMA_MYSQL_INT_VERSION < 32307 ? '' : '<a href="./server_processlist.php?'. $url_query . (empty($full) ? '&amp;full=1' : '') . '" title="' . (empty($full) ? $strShowFullQueries : $strTruncateQueries) . '"><img src="./images/' . (empty($full) ? 'full' : 'partial') . 'text.png" width="50" height="20" border="0" alt="' . (empty($full) ? $strShowFullQueries : $strTruncateQueries) . '" /></a>'; ?></th> <th><a href="./server_processlist.php?<?php echo $url_query . (empty($full) ? '&amp;full=1' : ''); ?>" title="<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>"><img src="./images/<?php echo empty($full) ? 'full' : 'partial'; ?>text.png" width="50" height="20" border="0" alt="<?php echo empty($full) ? $strShowFullQueries : $strTruncateQueries; ?>" /></a></th>
<th>&nbsp;<?php echo $strId; ?>&nbsp;</th> <th>&nbsp;<?php echo $strId; ?>&nbsp;</th>
<th>&nbsp;<?php echo $strUser; ?>&nbsp;</th> <th>&nbsp;<?php echo $strUser; ?>&nbsp;</th>
<th>&nbsp;<?php echo $strHost; ?>&nbsp;</th> <th>&nbsp;<?php echo $strHost; ?>&nbsp;</th>

View File

@@ -179,11 +179,11 @@ unset($tmp_array);
$useBgcolorOne = TRUE; $useBgcolorOne = TRUE;
$countRows = 0; $countRows = 0;
while (list($name, $value) = each($queryStats)) { foreach ($queryStats as $name => $value) {
// For the percentage column, use Questions - Connections, because // For the percentage column, use Questions - Connections, because
// the number of connections is not an item of the Query types // the number of connections is not an item of the Query types
// but is included in Questions. Then the total of the percentages is 100. // but is included in Questions. Then the total of the percentages is 100.
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo htmlspecialchars($name); ?>&nbsp;</td> <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo htmlspecialchars($name); ?>&nbsp;</td>

View File

@@ -78,7 +78,7 @@ echo '&nbsp;</th>' . "\n";
</tr> </tr>
<?php <?php
$useBgcolorOne = TRUE; $useBgcolorOne = TRUE;
while (list($name, $value) = each($serverVars)) { foreach ($serverVars as $name => $value) {
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">
@@ -110,4 +110,4 @@ while (list($name, $value) = each($serverVars)) {
*/ */
require('./footer.inc.php'); require('./footer.inc.php');
?> ?>