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:
-rw-r--r--plugins/CoreAdminHome/Commands/OptimizeArchiveTables.php8
-rw-r--r--plugins/CoreAdminHome/tests/Integration/Commands/OptimizeArchiveTablesTest.php5
2 files changed, 9 insertions, 4 deletions
diff --git a/plugins/CoreAdminHome/Commands/OptimizeArchiveTables.php b/plugins/CoreAdminHome/Commands/OptimizeArchiveTables.php
index 9a09dd7350..0e3887b261 100644
--- a/plugins/CoreAdminHome/Commands/OptimizeArchiveTables.php
+++ b/plugins/CoreAdminHome/Commands/OptimizeArchiveTables.php
@@ -66,9 +66,9 @@ class OptimizeArchiveTables extends ConsoleCommand
private function getTableMonthsToOptimize(InputInterface $input)
{
- $dateSpecifier = $input->getArgument('dates');
- if (count($dateSpecifier) === 1) {
- $dateSpecifier = reset($dateSpecifier);
+ $dateSpecifiers = $input->getArgument('dates');
+ if (count($dateSpecifiers) === 1) {
+ $dateSpecifier = reset($dateSpecifiers);
if ($dateSpecifier == self::ALL_TABLES_STRING) {
return $this->getAllArchiveTableMonths();
@@ -90,7 +90,7 @@ class OptimizeArchiveTables extends ConsoleCommand
}
$tableMonths = array();
- foreach ($dateSpecifier as $date) {
+ foreach ($dateSpecifiers as $date) {
$date = Date::factory($date);
$tableMonths[] = ArchiveTableCreator::getTableMonthFromDate($date);
}
diff --git a/plugins/CoreAdminHome/tests/Integration/Commands/OptimizeArchiveTablesTest.php b/plugins/CoreAdminHome/tests/Integration/Commands/OptimizeArchiveTablesTest.php
index 2fe67b98f2..c309650024 100644
--- a/plugins/CoreAdminHome/tests/Integration/Commands/OptimizeArchiveTablesTest.php
+++ b/plugins/CoreAdminHome/tests/Integration/Commands/OptimizeArchiveTablesTest.php
@@ -87,6 +87,11 @@ class OptimizeArchiveTablesTest extends ConsoleCommandTestCase
Date::factory('now')->subMonth(5)->toString('Y_m'),
),
),
+
+ array(
+ array('2015-01-01'),
+ array('2015_01'),
+ ),
);
}
} \ No newline at end of file