From 5447bd01639347c7ee88f7328d65b43d1935c206 Mon Sep 17 00:00:00 2001
From: mattab <matthieu.aubry@gmail.com>
Date: Thu, 19 Mar 2015 19:32:00 +1300
Subject: [PATCH] Rename creation_time -> segment_creation_time

---
 config/global.ini.php                              |  8 ++++----
 .../SegmentArchivingRequestUrlProvider.php         |  2 +-
 .../SegmentArchivingRequestUrlProviderTest.php     | 14 +++++++-------
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/config/global.ini.php b/config/global.ini.php
index c23522ab53..b892b7d822 100644
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -222,10 +222,10 @@ allow_adding_segments_for_all_websites = 1
 
 ; When archiving segments for the first time, this determines the oldest date that will be archived.
 ; This option can be used to avoid archiving (for isntance) the lastN years for every new segment.
-; Valid option values include: beginning_of_time (start date of archiving will not be changed)
-;                              creation_time (start date of archiving will be the creation date of the segment)
-;                              lastN where N is an integer (start date of archiving will be N days before the creation date)
-process_new_segments_from = beginning_of_time
+; Valid option values include: "beginning_of_time" (start date of archiving will not be changed)
+;                              "segment_creation_time" (start date of archiving will be the creation date of the segment)
+;                              lastN where N is an integer (eg "last10" to archive for 10 days before the segment creation date)
+process_new_segments_from = "beginning_of_time"
 
 ; this action name is used when the URL ends with a slash /
 ; it is useful to have an actual string to write in the UI
diff --git a/core/CronArchive/SegmentArchivingRequestUrlProvider.php b/core/CronArchive/SegmentArchivingRequestUrlProvider.php
index 332d5f5cee..fcd1dd8d10 100644
--- a/core/CronArchive/SegmentArchivingRequestUrlProvider.php
+++ b/core/CronArchive/SegmentArchivingRequestUrlProvider.php
@@ -22,7 +22,7 @@ use Piwik\Plugins\SegmentEditor\Model;
 class SegmentArchivingRequestUrlProvider
 {
     const BEGINNING_OF_TIME = 'beginning_of_time';
-    const CREATION_TIME = 'creation_time';
+    const CREATION_TIME = 'segment_creation_time';
 
     /**
      * @var Model
diff --git a/tests/PHPUnit/Unit/CronArchive/SegmentArchivingRequestUrlProviderTest.php b/tests/PHPUnit/Unit/CronArchive/SegmentArchivingRequestUrlProviderTest.php
index 575b7b0c2f..b564f6acdc 100644
--- a/tests/PHPUnit/Unit/CronArchive/SegmentArchivingRequestUrlProviderTest.php
+++ b/tests/PHPUnit/Unit/CronArchive/SegmentArchivingRequestUrlProviderTest.php
@@ -98,7 +98,7 @@ class SegmentArchivingRequestUrlProviderTest extends \PHPUnit_Framework_TestCase
             ),
 
             array( // test creation_time uses creation time of segment
-                'creation_time',
+                'segment_creation_time',
                 1,
                 $dateRange,
                 'week',
@@ -106,8 +106,8 @@ class SegmentArchivingRequestUrlProviderTest extends \PHPUnit_Framework_TestCase
                 "2014-01-01,2015-03-01"
             ),
 
-            array( // test creation_time uses earliest time of segment if multiple match (multiple for site)
-                'creation_time',
+            array( // test segment_creation_time uses earliest time of segment if multiple match (multiple for site)
+                'segment_creation_time',
                 1,
                 $dateRange,
                 'week',
@@ -115,8 +115,8 @@ class SegmentArchivingRequestUrlProviderTest extends \PHPUnit_Framework_TestCase
                 '2012-01-01,2015-03-01'
             ),
 
-            array( // test creation_time uses earliest time of segment if multiple match (multiple for site + one for all)
-                'creation_time',
+            array( // test segment_creation_time uses earliest time of segment if multiple match (multiple for site + one for all)
+                'segment_creation_time',
                 2,
                 $dateRange,
                 'week',
@@ -125,7 +125,7 @@ class SegmentArchivingRequestUrlProviderTest extends \PHPUnit_Framework_TestCase
             ),
 
             array( // test 'now' is used if no site matches (testing w/o any segments)
-                'creation_time',
+                'segment_creation_time',
                 1,
                 $dateRange,
                 'week',
@@ -134,7 +134,7 @@ class SegmentArchivingRequestUrlProviderTest extends \PHPUnit_Framework_TestCase
             ),
 
             array( // test 'now' is used if no site matches (testing w/ segment for another site)
-                'creation_time',
+                'segment_creation_time',
                 3,
                 $dateRange,
                 'week',
-- 
GitLab