added the $cfgShowStats setting

This commit is contained in:
Loïc Chapeaux
2001-09-20 08:04:03 +00:00
parent 6026f15e75
commit 8a4bb53fc4
5 changed files with 254 additions and 204 deletions

View File

@@ -5,6 +5,14 @@ phpMyAdmin - Changelog
$Id$
$Source$
2001-09-20 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* main.php3: fixed an error I've done while merging patch #462787.
* config.inc.php3; Documentation.html: added the $cfgShowStats setting and
resorted the core phpMyAdmin settings in a more logical way.
* db_details.php3; db_printview.php3; tbl_properties.php3;
tbl_printview.php3: added the $cfgShowStats setting.
* lang/italian.inc.php3: updated thanks to Pietro Danesi.
2001-09-19 Marc Delisle <lem9@users.sourceforge.net>
* tbl_properties.php3, db_details.php3, lang/*: start to merge new messages
with parameters.

View File

@@ -139,7 +139,12 @@ else if (MYSQL_INT_VERSION >= 32300) {
<th colspan="6"><?php echo ucfirst($strAction); ?></th>
<th><?php echo ucfirst($strRecords); ?></th>
<th><?php echo ucfirst($strType); ?></th>
<th><?php echo ucfirst($strSize); ?></th>
<?php
if ($cfgShowStats) {
echo '<th>' . ucfirst($strSize) . '</th>';
}
echo "\n";
?>
</tr>
<?php
$i = $sum_entries = $sum_size = 0;
@@ -201,7 +206,7 @@ else if (MYSQL_INT_VERSION >= 32300) {
if (isset($sts_data['Rows'])) {
if ($mergetable == FALSE) {
if ($nonisam == FALSE) {
if ($cfgShowStats && $nonisam == FALSE) {
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
$sum_size += $tblsize;
if ($tblsize > 0) {
@@ -209,20 +214,18 @@ else if (MYSQL_INT_VERSION >= 32300) {
} else {
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
}
} else {
} else if ($cfgShowStats) {
$formated_size = '&nbsp;-&nbsp;';
$unit = '';
}
if (isset($sts_data['Rows'])) {
$sum_entries += $sts_data['Rows'];
}
}
// MyISAM MERGE Table
else if ($mergetable == TRUE) {
else if ($cfgShowStats && $mergetable == TRUE) {
$formated_size = '&nbsp;-&nbsp;';
$unit = '';
}
else {
else if ($cfgShowStats) {
$formated_size = 'unknown';
$unit = '';
}
@@ -240,11 +243,17 @@ else if (MYSQL_INT_VERSION >= 32300) {
<td nowrap="nowrap">
&nbsp;<?php echo (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;'); ?>&nbsp;
</td>
<?php
if ($cfgShowStats) {
echo "\n";
?>
<td align="right" nowrap="nowrap">
&nbsp;&nbsp;
<a href="tbl_properties.php3?<?php echo $url_query; ?>#showusage"><?php echo $formated_size . ' ' . $unit; ?></a>
</td>
<?php
echo "\n";
} // end if
} else {
?>
<td colspan="3" align="center">
@@ -258,7 +267,9 @@ else if (MYSQL_INT_VERSION >= 32300) {
<?php
}
// Show Summary
list($sum_formated,$unit) = format_byte_down($sum_size,3,1);
if ($cfgShowStats) {
list($sum_formated, $unit) = format_byte_down($sum_size, 3, 1);
}
echo "\n";
?>
<tr>
@@ -275,13 +286,21 @@ else if (MYSQL_INT_VERSION >= 32300) {
<th align="center">
<b>--</b>
</td>
<?php
if ($cfgShowStats) {
echo "\n";
?>
<th align="right" nowrap="nowrap">
<b><?php echo $sum_formated . ' '. $unit; ?></b>
</th>
<?php
}
echo "\n";
?>
</tr>
<tr>
<td colspan="11">
<td colspan="<?php echo (($cfgShowStats) ? '11' : '10'); ?>">
<img src="./images/arrow.gif" border="0" width="38" height="22" alt="<?php echo $strWithChecked; ?>" />
<i><?php echo $strWithChecked; ?></i>&nbsp;&nbsp;
<input type="submit" name="submit_mult" value="<?php echo $strDrop; ?>" />

View File

@@ -89,7 +89,12 @@ else if (MYSQL_INT_VERSION >= 32300) {
<th>&nbsp;<?php echo ucfirst($strTable); ?>&nbsp;</th>
<th><?php echo ucfirst($strRecords); ?></th>
<th><?php echo ucfirst($strType); ?></th>
<th><?php echo ucfirst($strSize); ?></th>
<?php
if ($cfgShowStats) {
echo '<th>' . ucfirst($strSize) . '</th>';
}
echo "\n";
?>
</tr>
<?php
$i = $sum_entries = $sum_size = 0;
@@ -116,7 +121,7 @@ else if (MYSQL_INT_VERSION >= 32300) {
if (isset($sts_data['Rows'])) {
if ($mergetable == FALSE) {
if ($nonisam == FALSE) {
if ($cfgShowStats && $nonisam == FALSE) {
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
$sum_size += $tblsize;
if ($tblsize > 0) {
@@ -124,20 +129,18 @@ else if (MYSQL_INT_VERSION >= 32300) {
} else {
list($formated_size, $unit) = format_byte_down($tblsize, 3, 0);
}
} else {
} else if ($cfgShowStats) {
$formated_size = '&nbsp;-&nbsp;';
$unit = '';
}
if (isset($sts_data['Rows'])) {
$sum_entries += $sts_data['Rows'];
}
}
// MyISAM MERGE Table
else if ($mergetable == TRUE) {
else if ($cfgShowStats && $mergetable == TRUE) {
$formated_size = '&nbsp;-&nbsp;';
$unit = '';
}
else {
else if ($cfgShowStats) {
$formated_size = 'unknown';
$unit = '';
}
@@ -155,10 +158,16 @@ else if (MYSQL_INT_VERSION >= 32300) {
<td nowrap="nowrap">
&nbsp;<?php echo (isset($sts_data['Type']) ? $sts_data['Type'] : '&nbsp;'); ?>&nbsp;
</td>
<?php
if ($cfgShowStats) {
echo "\n";
?>
<td align="right" nowrap="nowrap">
&nbsp;<?php echo $formated_size . ' ' . $unit . "\n"; ?>
</td>
<?php
echo "\n";
} // end if
} else {
?>
<td colspan="3" align="center">
@@ -172,7 +181,9 @@ else if (MYSQL_INT_VERSION >= 32300) {
<?php
}
// Show Summary
list($sum_formated,$unit) = format_byte_down($sum_size,3,1);
if ($cfgShowStats) {
list($sum_formated, $unit) = format_byte_down($sum_size, 3, 1);
}
echo "\n";
?>
<tr>
@@ -185,9 +196,17 @@ else if (MYSQL_INT_VERSION >= 32300) {
<th align="center">
<b>--</b>
</td>
<?php
if ($cfgShowStats) {
echo "\n";
?>
<th align="right" nowrap="nowrap">
<b><?php echo $sum_formated . ' '. $unit; ?></b>
</th>
<?php
}
echo "\n";
?>
</tr>
</table>
<?php

View File

@@ -256,11 +256,12 @@ if ($index_count > 0) {
*
* staybyte - 9 June 2001
*/
$nonisam = FALSE;
if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
if ($cfgShowStats) {
$nonisam = FALSE;
if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
$nonisam = TRUE;
}
if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
}
if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
// Gets some sizes
$mergetable = FALSE;
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
@@ -427,7 +428,8 @@ if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
</table>
<?php
} // end if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE)
} // end if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE)
} // end if ($cfgShowStats)
/**

View File

@@ -522,11 +522,12 @@ if ($index_count > 0) {
* Displays Space usage and row statistics
*/
// BEGIN - Calc Table Space - staybyte - 9 June 2001
$nonisam = FALSE;
if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
if ($cfgShowStats) {
$nonisam = FALSE;
if (isset($showtable['Type']) && !eregi('ISAM|HEAP', $showtable['Type'])) {
$nonisam = TRUE;
}
if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
}
if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
// Gets some sizes
$mergetable = FALSE;
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
@@ -702,6 +703,7 @@ if (MYSQL_INT_VERSION >= 32303 && $nonisam == FALSE) {
</table>
</td>
<?php
}
}
// END - Calc Table Space
echo "\n";