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
path: root/core
diff options
context:
space:
mode:
authordizzy <diosmosis@users.noreply.github.com>2021-02-03 05:57:43 +0300
committerGitHub <noreply@github.com>2021-02-03 05:57:43 +0300
commit6813f065dd3b0f043025c2a412c72f9b900cee07 (patch)
tree42be4d91a2737cd5237d08e541812b7b154bda19 /core
parent41ca1a79e702a3330299db6d6552b81ed77c4f23 (diff)
add visitfrequency archiver to archive dependent archives (#17168)
* add visitfrequency archiver to archive dependent archives * bump version * add update file
Diffstat (limited to 'core')
-rw-r--r--core/Updates/4.1.2-b1.php62
-rw-r--r--core/Version.php2
2 files changed, 63 insertions, 1 deletions
diff --git a/core/Updates/4.1.2-b1.php b/core/Updates/4.1.2-b1.php
new file mode 100644
index 0000000000..fbd9d52fd8
--- /dev/null
+++ b/core/Updates/4.1.2-b1.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+
+namespace Piwik\Updates;
+
+use Piwik\Archive\ArchiveInvalidator;
+use Piwik\ArchiveProcessor\Rules;
+use Piwik\Container\StaticContainer;
+use Piwik\Date;
+use Piwik\Updater;
+use Piwik\Updates as PiwikUpdates;
+use Piwik\Updater\Migration\Factory as MigrationFactory;
+
+class Updates_4_1_2_b1 extends PiwikUpdates
+{
+ /**
+ * @var MigrationFactory
+ */
+ private $migration;
+
+ public function __construct(MigrationFactory $factory)
+ {
+ $this->migration = $factory;
+ }
+
+ public function getMigrations(Updater $updater)
+ {
+ $migrations = [];
+
+ if (!Rules::isBrowserTriggerEnabled()) {
+ $dateOfMatomo4Release = Date::factory('2020-11-23');
+
+ $cmdStr = $this->getInvalidateCommand($dateOfMatomo4Release);
+
+ $migrations[] = new Updater\Migration\Custom(function () use ($dateOfMatomo4Release) {
+ $invalidator = StaticContainer::get(ArchiveInvalidator::class);
+ $invalidator->scheduleReArchiving('all', 'VisitFrequency', null, $dateOfMatomo4Release);
+ }, $cmdStr);
+ }
+
+ return $migrations;
+ }
+
+ public function doUpdate(Updater $updater)
+ {
+ $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
+ }
+
+ private function getInvalidateCommand(Date $dateOfMatomo4Release)
+ {
+ $command = "php " . PIWIK_INCLUDE_PATH . '/console core:invalidate-report-data --sites=all';
+ $command .= ' --dates=' . $dateOfMatomo4Release->toString() . ',' . Date::factory('today')->toString();
+ $command .= ' --plugin=VisitFrequency';
+ return $command;
+ }
+} \ No newline at end of file
diff --git a/core/Version.php b/core/Version.php
index 316b08c26d..43cbfddc57 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -20,7 +20,7 @@ final class Version
* The current Matomo version.
* @var string
*/
- const VERSION = '4.1.1';
+ const VERSION = '4.1.2-b1';
const MAJOR_VERSION = 4;
public function isStableVersion($version)