diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-06-06 07:35:26 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-06-06 07:35:26 +0400 |
commit | 5aacb1ea5a3954909cea62b797905cccf61a9edf (patch) | |
tree | 42482990bed1eac86496b48ad3fc3e2ad836900e /plugins/VisitorInterest | |
parent | 7480a87f4507b56f5ab5d9337cb528a86eb4d233 (diff) |
Introducing new PluginsArchiver class. Plugins can create an Archiver inheriting this abstract class.
Diffstat (limited to 'plugins/VisitorInterest')
-rw-r--r-- | plugins/VisitorInterest/Archiver.php (renamed from plugins/VisitorInterest/Archiving.php) | 24 | ||||
-rw-r--r-- | plugins/VisitorInterest/VisitorInterest.php | 8 |
2 files changed, 16 insertions, 16 deletions
diff --git a/plugins/VisitorInterest/Archiving.php b/plugins/VisitorInterest/Archiver.php index 124d3cc3b9..8008671d9b 100644 --- a/plugins/VisitorInterest/Archiving.php +++ b/plugins/VisitorInterest/Archiver.php @@ -9,7 +9,7 @@ * @package Piwik_VisitorInterest */ -class Piwik_VisitorInterest_Archiving +class Piwik_VisitorInterest_Archiver extends Piwik_PluginsArchiver { // third element is unit (s for seconds, default is munutes) protected static $timeGap = array( @@ -78,7 +78,7 @@ class Piwik_VisitorInterest_Archiving array(364) ); - public function archiveDay(Piwik_ArchiveProcessing_Day $archiveProcessing) + public function archiveDay() { // these prefixes are prepended to the 'SELECT as' parts of each SELECT expression. detecting // these prefixes allows us to get all the data in one query. @@ -111,26 +111,26 @@ class Piwik_VisitorInterest_Archiving $timeGapSelects, $pageGapSelects, $visitsByVisitNumSelects, $daysSinceLastVisitSelects); // select data for every report - $row = $archiveProcessing->queryVisitsSimple(implode(',', $selects)); + $row = $this->getProcessor()->queryVisitsSimple(implode(',', $selects)); // archive visits by total time report $recordName = 'VisitorInterest_timeGap'; - $this->archiveRangeStats($archiveProcessing, $recordName, $row, Piwik_Archive::INDEX_NB_VISITS, $timeGapPrefix); + $this->archiveRangeStats($recordName, $row, Piwik_Archive::INDEX_NB_VISITS, $timeGapPrefix); // archive visits by total actions report $recordName = 'VisitorInterest_pageGap'; - $this->archiveRangeStats($archiveProcessing, $recordName, $row, Piwik_Archive::INDEX_NB_VISITS, $pageGapPrefix); + $this->archiveRangeStats($recordName, $row, Piwik_Archive::INDEX_NB_VISITS, $pageGapPrefix); // archive visits by visit number report $recordName = 'VisitorInterest_visitsByVisitCount'; - $this->archiveRangeStats($archiveProcessing, $recordName, $row, Piwik_Archive::INDEX_NB_VISITS, $visitsByVisitNumPrefix); + $this->archiveRangeStats($recordName, $row, Piwik_Archive::INDEX_NB_VISITS, $visitsByVisitNumPrefix); // archive days since last visit report $recordName = 'VisitorInterest_daysSinceLastVisit'; - $this->archiveRangeStats($archiveProcessing, $recordName, $row, Piwik_Archive::INDEX_NB_VISITS, $daysSinceLastVisitPrefix); + $this->archiveRangeStats($recordName, $row, Piwik_Archive::INDEX_NB_VISITS, $daysSinceLastVisitPrefix); } - public function archivePeriod(Piwik_ArchiveProcessing $archiveProcessing) + public function archivePeriod() { $dataTableToSum = array( 'VisitorInterest_timeGap', @@ -138,7 +138,7 @@ class Piwik_VisitorInterest_Archiving 'VisitorInterest_visitsByVisitCount', 'VisitorInterest_daysSinceLastVisit' ); - $archiveProcessing->archiveDataTable($dataTableToSum); + $this->getProcessor()->archiveDataTable($dataTableToSum); } @@ -173,10 +173,10 @@ class Piwik_VisitorInterest_Archiving * with this string as a prefix are used in creating * the DataTable.' */ - protected function archiveRangeStats($archiveProcessing, $recordName, $row, $index, $selectAsPrefix) + protected function archiveRangeStats($recordName, $row, $index, $selectAsPrefix) { - $dataTable = $archiveProcessing->getSimpleDataTableFromRow($row, $index, $selectAsPrefix); + $dataTable = $this->getProcessor()->getSimpleDataTableFromRow($row, $index, $selectAsPrefix); - $archiveProcessing->insertBlobRecord($recordName, $dataTable->getSerialized()); + $this->getProcessor()->insertBlobRecord($recordName, $dataTable->getSerialized()); } }
\ No newline at end of file diff --git a/plugins/VisitorInterest/VisitorInterest.php b/plugins/VisitorInterest/VisitorInterest.php index 3f5c219871..b3f948d93e 100644 --- a/plugins/VisitorInterest/VisitorInterest.php +++ b/plugins/VisitorInterest/VisitorInterest.php @@ -128,8 +128,8 @@ class Piwik_VisitorInterest extends Piwik_Plugin $archiveProcessing = $notification->getNotificationObject(); if (!$archiveProcessing->shouldProcessReportsForPlugin($this->getPluginName())) return; - $archiving = new Piwik_VisitorInterest_Archiving(); - $archiving->archivePeriod($archiveProcessing); + $archiving = new Piwik_VisitorInterest_Archiver($archiveProcessing); + $archiving->archivePeriod(); } public function archiveDay($notification) @@ -137,8 +137,8 @@ class Piwik_VisitorInterest extends Piwik_Plugin $archiveProcessing = $notification->getNotificationObject(); if (!$archiveProcessing->shouldProcessReportsForPlugin($this->getPluginName())) return; - $archiving = new Piwik_VisitorInterest_Archiving(); - $archiving->archiveDay($archiveProcessing); + $archiving = new Piwik_VisitorInterest_Archiver($archiveProcessing); + $archiving->archiveDay(); } |