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:
authormattab <matthieu.aubry@gmail.com>2015-03-19 10:41:52 +0300
committermattab <matthieu.aubry@gmail.com>2015-03-19 10:41:52 +0300
commit13523fa494bf35e949009c5e2e31559afe321573 (patch)
tree1469abf01faa0b1f1607c4fb10e62e9da67986c6 /core/CronArchive
parent0dcd19441ffcc977c275f5d7823acf493f98a677 (diff)
Revert previous commit and add unit test
Diffstat (limited to 'core/CronArchive')
-rw-r--r--core/CronArchive/SegmentArchivingRequestUrlProvider.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/CronArchive/SegmentArchivingRequestUrlProvider.php b/core/CronArchive/SegmentArchivingRequestUrlProvider.php
index 9dafd9f66e..d43fc03ed5 100644
--- a/core/CronArchive/SegmentArchivingRequestUrlProvider.php
+++ b/core/CronArchive/SegmentArchivingRequestUrlProvider.php
@@ -64,8 +64,8 @@ class SegmentArchivingRequestUrlProvider
// if the start date for the archiving request is before the minimum date allowed for processing this segment,
// use the minimum allowed date as the start date
$periodObj = PeriodFactory::build($period, $date);
- $endDate = $periodObj->getDateEnd();
if ($periodObj->getDateStart()->getTimestamp() < $oldestDateToProcessForNewSegment->getTimestamp()) {
+ $endDate = $periodObj->getDateEnd();
// if the creation time of a segment is older than the end date of the archiving request range, we cannot
// blindly rewrite the date string, since the resulting range would be incorrect. instead we make the
@@ -74,8 +74,8 @@ class SegmentArchivingRequestUrlProvider
$oldestDateToProcessForNewSegment = $endDate;
}
+ $date = $oldestDateToProcessForNewSegment->toString().','.$endDate;
}
- $date = $oldestDateToProcessForNewSegment->toString().','.$endDate;
return $date;
}
@@ -84,7 +84,7 @@ class SegmentArchivingRequestUrlProvider
{
if ($this->processNewSegmentsFrom == self::CREATION_TIME) {
return $segmentCreatedTime;
- } else if (preg_match("/^last([0-9]*)$/", $this->processNewSegmentsFrom, $matches)) {
+ } else if (preg_match("/^last([0-9]+)$/", $this->processNewSegmentsFrom, $matches)) {
$lastN = $matches[1];
list($lastDate, $lastPeriod) = Range::getDateXPeriodsAgo($lastN, $segmentCreatedTime, 'day');