function theme_db_maintenance_block in DB Maintenance 5
Same name and namespace in other branches
- 5.2 db_maintenance.module \theme_db_maintenance_block()
MySQL size status by pcs305
1 theme call to theme_db_maintenance_block()
- db_maintenance_block in ./
db_maintenance.module - Implementation of hook_block().
File
- ./
db_maintenance.module, line 240 - Optimizes database tables during cron runs.
Code
function theme_db_maintenance_block() {
// Database size = table size + index size:
$rows = db_query("SHOW TABLE STATUS");
$dbssize = 0;
while ($row = mysql_fetch_array($rows)) {
$dbssize += $row['Data_length'] + $row['Index_length'];
}
$dbssize = db_maintenance_db_size_info($dbssize);
return "{$dbssize['size']} {$dbssize['type']}";
}