diff options
author | diosmosis <benaka@piwik.pro> | 2014-11-14 05:22:49 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-11-14 05:22:49 +0300 |
commit | 545d316d4dad434edfe5048807bfbe686f856259 (patch) | |
tree | 2f82ab2c064539c0624b7496ccfd41398dee75db /plugins/DBStats/Controller.php | |
parent | f57473c98324fa6026c4e7776f30c104d81d0989 (diff) |
Make MetricsFormatter a class with instance methods and move Html related functionality to derived class. Use FOrmatter in Metric::format calls so Metrics do not have to be aware of context of formatting, and so Metric::format methods will have less code redundancy.
Diffstat (limited to 'plugins/DBStats/Controller.php')
-rw-r--r-- | plugins/DBStats/Controller.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/DBStats/Controller.php b/plugins/DBStats/Controller.php index de36313264..1e8aad1311 100644 --- a/plugins/DBStats/Controller.php +++ b/plugins/DBStats/Controller.php @@ -8,7 +8,7 @@ */ namespace Piwik\Plugins\DBStats; -use Piwik\MetricsFormatter; +use Piwik\Metrics\Formatter; use Piwik\Piwik; use Piwik\Plugins\DBStats\Reports\GetAdminDataSummary; use Piwik\Plugins\DBStats\Reports\GetDatabaseUsageSummary; @@ -42,9 +42,10 @@ class Controller extends \Piwik\Plugin\ControllerAdmin list($siteCount, $userCount, $totalSpaceUsed) = API::getInstance()->getGeneralInformation(); - $view->siteCount = MetricsFormatter::getPrettyNumber($siteCount); - $view->userCount = MetricsFormatter::getPrettyNumber($userCount); - $view->totalSpaceUsed = MetricsFormatter::getPrettySizeFromBytes($totalSpaceUsed); + $formatter = new Formatter(); + $view->siteCount = $formatter->getPrettyNumber($siteCount); + $view->userCount = $formatter->getPrettyNumber($userCount); + $view->totalSpaceUsed = $formatter->getPrettySizeFromBytes($totalSpaceUsed); return $view->render(); } |