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:
authorStefan Giehl <stefan@matomo.org>2022-08-23 03:12:37 +0300
committerGitHub <noreply@github.com>2022-08-23 03:12:37 +0300
commit2b8b7d0103ef2627ac32ff2cf06560749e5083a1 (patch)
tree34a9839553f28c3fc5ecc14c43fd415e89d165c6
parent5039b8effa058ef6b65c966d5d2b7cad76c3a523 (diff)
Fix logging when invalidating reports (#19641)
-rw-r--r--core/Archive/ArchiveInvalidator/InvalidationResult.php11
-rw-r--r--plugins/CoreAdminHome/Commands/InvalidateReportData.php5
2 files changed, 10 insertions, 6 deletions
diff --git a/core/Archive/ArchiveInvalidator/InvalidationResult.php b/core/Archive/ArchiveInvalidator/InvalidationResult.php
index ca7aae5fda..2b30e1b058 100644
--- a/core/Archive/ArchiveInvalidator/InvalidationResult.php
+++ b/core/Archive/ArchiveInvalidator/InvalidationResult.php
@@ -1,4 +1,5 @@
<?php
+
/**
* Matomo - free/libre analytics platform
*
@@ -21,14 +22,14 @@ class InvalidationResult
*
* @var array
*/
- public $warningDates = array();
+ public $warningDates = [];
/**
* Dates that were successfully invalidated.
*
* @var array
*/
- public $processedDates = array();
+ public $processedDates = [];
/**
* The day of the oldest log entry.
@@ -40,9 +41,9 @@ class InvalidationResult
/**
* @return string[]
*/
- public function makeOutputLogs()
+ public function makeOutputLogs(): array
{
- $output = array();
+ $output = [];
if ($this->warningDates) {
$output[] = 'Warning: the following Dates have not been invalidated, because they are earlier than your Log Deletion limit: ' .
implode(", ", $this->warningDates) .
@@ -53,4 +54,4 @@ class InvalidationResult
$output[] = "Success. The following dates were invalidated successfully: " . implode(", ", $this->processedDates);
return $output;
}
-} \ No newline at end of file
+}
diff --git a/plugins/CoreAdminHome/Commands/InvalidateReportData.php b/plugins/CoreAdminHome/Commands/InvalidateReportData.php
index cdb1f3240e..4b10f9e2c3 100644
--- a/plugins/CoreAdminHome/Commands/InvalidateReportData.php
+++ b/plugins/CoreAdminHome/Commands/InvalidateReportData.php
@@ -1,4 +1,5 @@
<?php
+
/**
* Matomo - free/libre analytics platform
*
@@ -109,7 +110,9 @@ class InvalidateReportData extends ConsoleCommand
false, $plugin, $ignoreLogDeletionLimit);
if ($output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL) {
- $logger->info($invalidationResult->makeOutputLogs());
+ foreach ($invalidationResult->makeOutputLogs() as $outputLog) {
+ $logger->info($outputLog);
+ }
}
}
}