Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-07-23 11:52:15 +0400
committermattab <matthieu.aubry@gmail.com>2013-07-23 11:52:15 +0400
commit5104d94f3b2250f766b9c520e2da8da9b4cab2e9 (patch)
tree5f30daf7bc14373fb1bbd0504ce11a771dafc02f /plugins/DBStats
parentae4b1f4e38077b174e4df5b7d4513d63fe026a24 (diff)
Refs #4059 Work in progress: Conversion to use Namespaces of dozen more classes
Removed many Piwik_ functions, in Piwik 2 it is best practise to use the methods calls instead Todo: finish converting core/ classes + convert plugins/ classes to use \Piwik\Plugin namespace + fix build + Merge master
Diffstat (limited to 'plugins/DBStats')
-rw-r--r--plugins/DBStats/Controller.php9
-rw-r--r--plugins/DBStats/DBStats.php5
-rwxr-xr-xplugins/DBStats/MySQLMetadataProvider.php10
3 files changed, 14 insertions, 10 deletions
diff --git a/plugins/DBStats/Controller.php b/plugins/DBStats/Controller.php
index 7596dc4106..8194c29cc4 100644
--- a/plugins/DBStats/Controller.php
+++ b/plugins/DBStats/Controller.php
@@ -8,13 +8,16 @@
* @category Piwik_Plugins
* @package Piwik_DBStats
*/
+use Piwik\Controller\Admin;
use Piwik\Piwik;
+use Piwik\ViewDataTable;
+use Piwik\View;
/**
*
* @package Piwik_DBStats
*/
-class Piwik_DBStats_Controller extends Piwik_Controller_Admin
+class Piwik_DBStats_Controller extends Admin
{
/**
* Returns the index for this plugin. Shows every other report defined by this plugin,
@@ -26,7 +29,7 @@ class Piwik_DBStats_Controller extends Piwik_Controller_Admin
public function index()
{
Piwik::checkUserIsSuperUser();
- $view = new Piwik_View('@DBStats/index');
+ $view = new View('@DBStats/index');
$this->setBasicVariablesView($view);
$view->databaseUsageSummary = $this->getDatabaseUsageSummary(true);
@@ -248,7 +251,7 @@ class Piwik_DBStats_Controller extends Piwik_Controller_Admin
'estimated_size' => Piwik_Translate('DBStats_EstimatedSize')
);
- $view = Piwik_ViewDataTable::factory($viewType);
+ $view = ViewDataTable::factory($viewType);
$view->init($this->pluginName, $function, "DBStats.$function");
$view->setSortedColumn('label', $orderDir);
$view->setLimit($limit);
diff --git a/plugins/DBStats/DBStats.php b/plugins/DBStats/DBStats.php
index 770e00f0ed..955c0b6812 100644
--- a/plugins/DBStats/DBStats.php
+++ b/plugins/DBStats/DBStats.php
@@ -10,6 +10,7 @@
*/
use Piwik\Piwik;
use Piwik\Date;
+use Piwik\ScheduledTask;
use Piwik\Plugin;
/**
@@ -45,12 +46,12 @@ class Piwik_DBStats extends Plugin
*/
public function getScheduledTasks(&$tasks)
{
- $cacheDataByArchiveNameReportsTask = new Piwik_ScheduledTask(
+ $cacheDataByArchiveNameReportsTask = new ScheduledTask(
$this,
'cacheDataByArchiveNameReports',
null,
new Piwik_ScheduledTime_Weekly(),
- Piwik_ScheduledTask::LOWEST_PRIORITY
+ ScheduledTask::LOWEST_PRIORITY
);
$tasks[] = $cacheDataByArchiveNameReportsTask;
}
diff --git a/plugins/DBStats/MySQLMetadataProvider.php b/plugins/DBStats/MySQLMetadataProvider.php
index c7701e6023..c21f6f6009 100755
--- a/plugins/DBStats/MySQLMetadataProvider.php
+++ b/plugins/DBStats/MySQLMetadataProvider.php
@@ -51,7 +51,7 @@ class Piwik_DBStats_MySQLMetadataProvider
mysql_close($link);
$status = explode(" ", $status);
} else {
- $fullStatus = Piwik_FetchAssoc('SHOW STATUS');
+ $fullStatus = Db::fetchAssoc('SHOW STATUS');
if (empty($fullStatus)) {
throw new Exception('Error, SHOW STATUS failed');
}
@@ -86,7 +86,7 @@ class Piwik_DBStats_MySQLMetadataProvider
if (!is_null($this->tableStatuses) && isset($this->tableStatuses[$prefixed])) {
return $this->tableStatuses[$prefixed];
} else {
- return Piwik_FetchRow("SHOW TABLE STATUS LIKE ?", array($prefixed));
+ return Db::fetchRow("SHOW TABLE STATUS LIKE ?", array($prefixed));
}
}
@@ -105,7 +105,7 @@ class Piwik_DBStats_MySQLMetadataProvider
$tablesPiwik = Piwik::getTablesInstalled();
$this->tableStatuses = array();
- foreach (Piwik_FetchAll("SHOW TABLE STATUS") as $t) {
+ foreach (Db::fetchAll("SHOW TABLE STATUS") as $t) {
if (in_array($t['Name'], $tablesPiwik)) {
$this->tableStatuses[$t['Name']] = $t;
}
@@ -232,7 +232,7 @@ class Piwik_DBStats_MySQLMetadataProvider
$sql = "SELECT name as 'label', COUNT(*) as 'row_count'$extraCols FROM {$status['Name']} GROUP BY name";
$table = new DataTable();
- $table->addRowsFromSimpleArray(Piwik_FetchAll($sql));
+ $table->addRowsFromSimpleArray(Db::fetchAll($sql));
$reduceArchiveRowName = array($this, 'reduceArchiveRowName');
$table->filter('GroupBy', array('label', $reduceArchiveRowName));
@@ -275,7 +275,7 @@ class Piwik_DBStats_MySQLMetadataProvider
static $fixedSizeColumnLength = null;
if (is_null($fixedSizeColumnLength)) {
$fixedSizeColumnLength = 0;
- foreach (Piwik_FetchAll("SHOW COLUMNS FROM " . $status['Name']) as $column) {
+ foreach (Db::fetchAll("SHOW COLUMNS FROM " . $status['Name']) as $column) {
$columnType = $column['Type'];
if (($paren = strpos($columnType, '(')) !== false) {