1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Provide size of all databases in the overview

This commit is contained in:
Jakub Vrana
2014-03-01 11:38:38 -08:00
parent a710c28d38
commit c369236333
8 changed files with 40 additions and 11 deletions

View File

@@ -505,3 +505,19 @@ function ob_gzencode($string) {
// ob_start() callback recieves an optional parameter $phase but gzencode() accepts optional parameter $level
return gzencode($string);
}
/** Compute size of database
* @param string
* @return string formatted
*/
function db_size($db) {
global $connection;
if (!$connection->select_db($db)) {
return "?";
}
$return = 0;
foreach (table_status() as $table_status) {
$return += $table_status["Data_length"] + $table_status["Index_length"];
}
return number_format($return, 0, '.', lang(','));
}