1
0
This repository has been archived on 2021-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
gallery3-contrib/3.0/modules/database_info/views/admin_block_db.html.php

19 lines
535 B
PHP

<?php defined("SYSPATH") or die("No direct script access.") ?>
<?
$db = Database::instance();
$tables = $db->query("SHOW TABLE STATUS");
$database_size = 0;
foreach($tables as $table) {
$database_size += ($table->Data_length + $table->Index_length);
}
$database_size = $database_size / 1024 / 1024;
?>
<ul>
<li>
<?= t("Database size: %dbsize MB", array("dbsize" => number_format($database_size, 2))) ?>
</li>
<li>
<?= t("Number of tables: %dbtables", array("dbtables" => count($tables))) ?>
</li>
</ul>