-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rWatcher
authored and
Tim Almdal
committed
Jun 18, 2010
1 parent
0ec53f5
commit eb1632d
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,36 @@ | |||
<?php defined("SYSPATH") or die("No direct script access."); | |||
/** | |||
* Gallery - a web based photo album viewer and editor | |||
* Copyright (C) 2000-2010 Bharat Mediratta | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or (at | |||
* your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, but | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
class database_info_block_Core { | |||
static function get_admin_list() { | |||
return array("database_info" => t("Database info")); | |||
} | |||
|
|||
static function get($block_id) { | |||
$block = new Block(); | |||
switch ($block_id) { | |||
case "database_info": | |||
$block->css_id = "g-database-info"; | |||
$block->title = t("Database information"); | |||
$block->content = new View("admin_block_db.html"); | |||
break; | |||
} | |||
return $block; | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
name = "Database Info" | |||
description = "View information about your Gallery 3 database on the admin dashboard." | |||
version = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,18 @@ | |||
<?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> |