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:
authordiosmosis <benaka@piwik.pro>2015-03-05 09:19:53 +0300
committerdiosmosis <benaka@piwik.pro>2015-03-05 09:19:53 +0300
commit534798ae6b20b6e5f8660a372a97162b8a0e90eb (patch)
tree8afa07bd8d878100bb638bf2c9573f74a32c494c /core/CronArchive
parent67677a192e220833ca0fc0e3279e3f792f1f1af5 (diff)
Refs #7181, rename remaining InvalidatedReports class to SitesToReprocessDistributedList and move to Piwik\CronArchive since CronArchive is only consumer of the list. Made the list derive from Piwik\Concurrency\DistributedList.
Diffstat (limited to 'core/CronArchive')
-rw-r--r--core/CronArchive/SitesToReprocessDistributedList.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/core/CronArchive/SitesToReprocessDistributedList.php b/core/CronArchive/SitesToReprocessDistributedList.php
new file mode 100644
index 0000000000..c16062105e
--- /dev/null
+++ b/core/CronArchive/SitesToReprocessDistributedList.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\CronArchive;
+
+use Piwik\Concurrency\DistributedList;
+
+/**
+ * Keeps track of which reports were invalidated via CoreAdminHome.invalidateArchivedReports API.
+ *
+ * This is used by:
+ *
+ * 1. core:archive command to know which websites should be reprocessed
+ *
+ * 2. scheduled task purgeInvalidatedArchives to know which websites/months should be purged
+ *
+ * TODO: modify
+ */
+class SitesToReprocessDistributedList extends DistributedList
+{
+ const OPTION_INVALIDATED_IDSITES_TO_REPROCESS = 'InvalidatedOldReports_WebsiteIds';
+
+ /**
+ * Constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct(self::OPTION_INVALIDATED_IDSITES_TO_REPROCESS);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function setAll($items)
+ {
+ $items = array_unique($items);
+ $items = array_values($items);
+
+ parent::setAll($items);
+ }
+} \ No newline at end of file