diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2008-12-22 11:17:30 +0300 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2008-12-22 11:17:30 +0300 |
commit | f257895928bb781ffd179ff4d4370eb331d90c83 (patch) | |
tree | f13f2968ded90a1a8bf0e34235910c0ed2545235 /plugins/DBStats/API.php | |
parent | 812e3fd2c17e556c69842175e6c2df7817b4ebc6 (diff) |
- fix actions table column names
- display total size used by piwik in dbUsage plugin
- adding tests in pre-release check
git-svn-id: http://dev.piwik.org/svn/trunk@841 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/DBStats/API.php')
-rw-r--r-- | plugins/DBStats/API.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/DBStats/API.php b/plugins/DBStats/API.php index 9fa169157f..5c26a6700e 100644 --- a/plugins/DBStats/API.php +++ b/plugins/DBStats/API.php @@ -63,14 +63,15 @@ class Piwik_DBStats_API static public function getAllTablesStatus() { - Piwik::isUserIsSuperUser(); + Piwik::checkUserIsSuperUser(); $db = Zend_Registry::get('db'); // http://dev.mysql.com/doc/refman/5.1/en/show-table-status.html $tablesPiwik = Piwik::getTablesInstalled(); $total = array('Name' => 'Total', 'Data_length' => 0, 'Index_length' => 0, 'Rows' => 0); - foreach($tablesPiwik as $table) + $table = array(); + foreach($tablesPiwik as $tableName) { - $t = self::getTableStatus($table); + $t = self::getTableStatus($tableName); $total['Data_length'] += $t['Data_length']; $total['Index_length'] += $t['Index_length']; $total['Rows'] += $t['Rows']; @@ -79,14 +80,14 @@ class Piwik_DBStats_API $t['Data_length'] = Piwik::getPrettySizeFromBytes($t['Data_length']); $t['Index_length'] = Piwik::getPrettySizeFromBytes($t['Index_length']); $t['Rows'] = Piwik::getPrettySizeFromBytes($t['Rows']); - $tables[] = $t; + $table[] = $t; } $total['Total_length'] = Piwik::getPrettySizeFromBytes($total['Data_length']+$total['Index_length']); $total['Data_length'] = Piwik::getPrettySizeFromBytes($total['Data_length']); $total['Index_length'] = Piwik::getPrettySizeFromBytes($total['Index_length']); $total['TotalRows'] = Piwik::getPrettySizeFromBytes($total['Rows']); - $tables['Total'] = $total; + $table['Total'] = $total; - return $tables; + return $table; } } |