update Piwik to version 2.16 (fixes #91)

This commit is contained in:
oliver 2016-04-10 18:55:57 +02:00
commit d885a4baa9
5833 changed files with 418860 additions and 226988 deletions

View file

@ -1,6 +1,6 @@
<?php
/**
* Piwik - Open source web analytics
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
@ -8,10 +8,9 @@
*/
namespace Piwik\Plugins\DBStats;
use Piwik\MetricsFormatter;
use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\View;
use Piwik\ViewDataTable\Factory;
/**
*/
@ -30,131 +29,19 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$view = new View('@DBStats/index');
$this->setBasicVariablesView($view);
$view->databaseUsageSummary = $this->getDatabaseUsageSummary(true);
$view->trackerDataSummary = $this->getTrackerDataSummary(true);
$view->metricDataSummary = $this->getMetricDataSummary(true);
$view->reportDataSummary = $this->getReportDataSummary(true);
$view->adminDataSummary = $this->getAdminDataSummary(true);
$view->databaseUsageSummary = $this->renderReport('getDatabaseUsageSummary');
$view->trackerDataSummary = $this->renderReport('getTrackerDataSummary');
$view->metricDataSummary = $this->renderReport('getMetricDataSummary');
$view->reportDataSummary = $this->renderReport('getReportDataSummary');
$view->adminDataSummary = $this->renderReport('getAdminDataSummary');
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();
}
/**
* Shows a datatable that displays how much space the tracker tables, numeric
* archive tables, report tables and other tables take up in the MySQL database.
*
* @return string
*/
public function getDatabaseUsageSummary()
{
Piwik::checkUserHasSuperUserAccess();
return $this->renderReport(__FUNCTION__);
}
/**
* Shows a datatable that displays the amount of space each individual log table
* takes up in the MySQL database.
* @return string|void
*/
public function getTrackerDataSummary()
{
Piwik::checkUserHasSuperUserAccess();
return $this->renderReport(__FUNCTION__);
}
/**
* Shows a datatable that displays the amount of space each numeric archive table
* takes up in the MySQL database.
*
* @return string|void
*/
public function getMetricDataSummary()
{
Piwik::checkUserHasSuperUserAccess();
return $this->renderReport(__FUNCTION__);
}
/**
* Shows a datatable that displays the amount of space each numeric archive table
* takes up in the MySQL database, for each year of numeric data.
*
* @return string|void
*/
public function getMetricDataSummaryByYear()
{
Piwik::checkUserHasSuperUserAccess();
return $this->renderReport(__FUNCTION__);
}
/**
* Shows a datatable that displays the amount of space each blob archive table
* takes up in the MySQL database.
*
* @return string|void
*/
public function getReportDataSummary()
{
Piwik::checkUserHasSuperUserAccess();
return $this->renderReport(__FUNCTION__);
}
/**
* Shows a datatable that displays the amount of space each blob archive table
* takes up in the MySQL database, for each year of blob data.
*
* @return string|void
*/
public function getReportDataSummaryByYear()
{
Piwik::checkUserHasSuperUserAccess();
return $this->renderReport(__FUNCTION__);
}
/**
* Shows a datatable that displays how many occurances there are of each individual
* report type stored in the MySQL database.
*
* Goal reports and reports of the format: .*_[0-9]+ are grouped together.
*
* @return string|void
*/
public function getIndividualReportsSummary()
{
Piwik::checkUserHasSuperUserAccess();
return $this->renderReport(__FUNCTION__);
}
/**
* Shows a datatable that displays how many occurances there are of each individual
* metric type stored in the MySQL database.
*
* Goal metrics, metrics of the format .*_[0-9]+ and 'done...' metrics are grouped together.
*
* @return string|void
*/
public function getIndividualMetricsSummary()
{
Piwik::checkUserHasSuperUserAccess();
return $this->renderReport(__FUNCTION__);
}
/**
* Shows a datatable that displays the amount of space each 'admin' table takes
* up in the MySQL database.
*
* An 'admin' table is a table that is not central to analytics functionality.
* So any table that isn't an archive table or a log table is an 'admin' table.
*
* @return string|void
*/
public function getAdminDataSummary()
{
Piwik::checkUserHasSuperUserAccess();
return $this->renderReport(__FUNCTION__);
}
}