From c866f47f5e7b9f872db969324786f0b28e7750d7 Mon Sep 17 00:00:00 2001 From: mattab Date: Mon, 12 May 2014 11:13:23 +1200 Subject: [PATCH] Do not mention archive.php in the sourcecode, instead mention `./console core:archive` command --- core/Archive.php | 3 +-- core/ArchiveProcessor/Rules.php | 4 ++-- core/CronArchive.php | 12 ++++++------ core/FrontController.php | 2 +- core/Http.php | 2 +- core/Log.php | 2 +- core/Period/Range.php | 2 +- core/SettingsPiwik.php | 2 +- core/SettingsServer.php | 2 +- core/TaskScheduler.php | 2 +- core/Url.php | 2 +- lang/en.json | 4 ++-- plugins/CoreAdminHome/API.php | 8 ++++---- tests/PHPUnit/Integration/ArchiveCronTest.php | 2 +- tests/PHPUnit/UI | 2 +- tests/PHPUnit/proxy/includes.php | 2 +- 16 files changed, 26 insertions(+), 27 deletions(-) diff --git a/core/Archive.php b/core/Archive.php index 431b5e818fd..99be7fd5038 100644 --- a/core/Archive.php +++ b/core/Archive.php @@ -100,8 +100,7 @@ * * * [1]: The archiving process will not be launched if browser archiving is disabled - * and the current request came from a browser (and not the **archive.php** cron - * script). + * and the current request came from a browser. * * * @api diff --git a/core/ArchiveProcessor/Rules.php b/core/ArchiveProcessor/Rules.php index 45250b0d231..fa19fa82beb 100644 --- a/core/ArchiveProcessor/Rules.php +++ b/core/ArchiveProcessor/Rules.php @@ -164,7 +164,7 @@ public static function shouldPurgeOutdatedArchives(Date $date) // We delete more often which is safe, since reports are re-processed on demand $purgeArchivesOlderThan = Date::factory(time() - 2 * $temporaryArchivingTimeout)->getDateTime(); } else { - // If archive.php via Cron is building the reports, we should keep all temporary reports from today + // If cron core:archive command is building the reports, we should keep all temporary reports from today $purgeArchivesOlderThan = Date::factory('today')->getDateTime(); } return $purgeArchivesOlderThan; @@ -234,7 +234,7 @@ public static function isArchivingDisabledFor(array $idSites, Segment $segment, if (!$segment->isEmpty() && $isArchivingDisabled && Config::getInstance()->General['browser_archiving_disabled_enforce'] - && !SettingsServer::isArchivePhpTriggered() // Only applies when we are not running archive.php + && !SettingsServer::isArchivePhpTriggered() // Only applies when we are not running core:archive command ) { Log::debug("Archiving is disabled because of config setting browser_archiving_disabled_enforce=1"); return true; diff --git a/core/CronArchive.php b/core/CronArchive.php index 5003cfc3c61..24978f1bab1 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -16,7 +16,7 @@ use Piwik\Plugins\SitesManager\API as APISitesManager; /** - * archive.php runs as a cron and is a useful tool for general maintenance, + * ./console core:archive runs as a cron and is a useful tool for general maintenance, * and pre-process reports for a Fast dashboard rendering. */ class CronArchive @@ -88,7 +88,7 @@ class CronArchive public $testmode = false; /** - * Returns the option name of the option that stores the time the archive.php script was last run. + * Returns the option name of the option that stores the time core:archive was last executed. * * @param int $idsite * @param string $period @@ -382,7 +382,7 @@ private function archiveSingleSite($idsite, $requestsBefore) return false; } - // Fake that the request is already done, so that other archive.php + // Fake that the request is already done, so that other core:archive commands // running do not grab the same website from the queue Option::set($this->lastRunKey($idsite, "day"), time()); @@ -803,7 +803,7 @@ public function filterWebsiteIds(&$websiteIds) $websiteIds = array_intersect($websiteIds, $this->allWebsites); /** - * Triggered by the **archive.php** cron script so plugins can modify the list of + * Triggered by the **core:archive** console command so plugins can modify the list of * websites that the archiving process will be launched for. * * Plugins can use this hook to add websites to archive, remove websites to archive, or change @@ -849,7 +849,7 @@ private function initTokenAuth() private function initPiwikHost() { - // If archive.php run as a web cron, we use the current hostname+path + // If core:archive command run as a web cron, we use the current hostname+path if (!Common::isPhpCliMode()) { if (!empty(self::$url)) { $piwikUrl = self::$url; @@ -858,7 +858,7 @@ private function initPiwikHost() $piwikUrl = SettingsPiwik::getPiwikUrl(); } } else { - // If archive.php run as CLI/shell we require the piwik url to be set + // If core:archive command run as CLI/shell we require the piwik url to be set $piwikUrl = $this->getParameterFromCli("url", true); if (!$piwikUrl) { diff --git a/core/FrontController.php b/core/FrontController.php index 5d9ddaf3b31..9a9927eb030 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -455,7 +455,7 @@ protected function handleSSLRedirection() private function handleProfiler() { if (!empty($_GET['xhprof'])) { - $mainRun = $_GET['xhprof'] == 1; // archive.php sets xhprof=2 + $mainRun = $_GET['xhprof'] == 1; // core:archive command sets xhprof=2 Profiler::setupProfilerXHProf($mainRun); } } diff --git a/core/Http.php b/core/Http.php index d6e7376999b..f131bc44cd5 100644 --- a/core/Http.php +++ b/core/Http.php @@ -443,7 +443,7 @@ public static function sendHttpRequestBy( CURLOPT_HEADER => is_resource($file) ? false : true, CURLOPT_CONNECTTIMEOUT => $timeout, ); - // Case archive.php is triggering archiving on https:// and the certificate is not valid + // Case core:archive command is triggering archiving on https:// and the certificate is not valid if ($acceptInvalidSslCertificate) { $curl_options += array( CURLOPT_SSL_VERIFYHOST => false, diff --git a/core/Log.php b/core/Log.php index 8e090fa4a06..e9b9153e176 100644 --- a/core/Log.php +++ b/core/Log.php @@ -43,7 +43,7 @@ * severe than the current log level will be outputted. Others will be * ignored. The default level is **WARN**. * - `log_only_when_cli`: 0 or 1. If 1, logging is only enabled when Piwik is executed - * in the command line (for example, by the archive.php cron + * in the command line (for example, by the core:archive command * script). Default: 0. * - `log_only_when_debug_parameter`: 0 or 1. If 1, logging is only enabled when the * `debug` query parameter is 1. Default: 0. diff --git a/core/Period/Range.php b/core/Period/Range.php index b60cc4ca61c..b2717b48245 100644 --- a/core/Period/Range.php +++ b/core/Period/Range.php @@ -23,7 +23,7 @@ * date=2007-07-24,2013-11-15). * * The range period differs from other periods mainly in that since it is arbitrary, - * range periods are not pre-archived by the **archive.php** cron script. + * range periods are not pre-archived by the cron core:archive command. * * @api */ diff --git a/core/SettingsPiwik.php b/core/SettingsPiwik.php index 6720853c459..3def75d1590 100644 --- a/core/SettingsPiwik.php +++ b/core/SettingsPiwik.php @@ -159,7 +159,7 @@ public static function getPiwikUrl() $isPiwikCoreDispatching = defined('PIWIK_ENABLE_DISPATCH') && PIWIK_ENABLE_DISPATCH; if (Common::isPhpCliMode() - // in case archive.php is triggered with domain localhost + // in case core:archive command is triggered (often with localhost domain) || SettingsServer::isArchivePhpTriggered() // When someone else than core is dispatching this request then we return the URL as it is read only || !$isPiwikCoreDispatching diff --git a/core/SettingsServer.php b/core/SettingsServer.php index ae9f6de4b69..f50156d7fe3 100644 --- a/core/SettingsServer.php +++ b/core/SettingsServer.php @@ -132,7 +132,7 @@ public static function raiseMemoryLimitIfNecessary() $minimumMemoryLimit = Config::getInstance()->General['minimum_memory_limit']; if (self::isArchivePhpTriggered()) { - // archive.php: no time limit, high memory limit + // core:archive command: no time limit, high memory limit self::setMaxExecutionTime(0); $minimumMemoryLimitWhenArchiving = Config::getInstance()->General['minimum_memory_limit_when_archiving']; if ($memoryLimit < $minimumMemoryLimitWhenArchiving) { diff --git a/core/TaskScheduler.php b/core/TaskScheduler.php index dabf4241d24..a3eab34c245 100644 --- a/core/TaskScheduler.php +++ b/core/TaskScheduler.php @@ -21,7 +21,7 @@ * weekly, monthly, etc.). They are registered with **TaskScheduler** through the * {@hook TaskScheduler.getScheduledTasks} event. * - * Tasks are executed when the cron archive.php script is executed. + * Tasks are executed when the cron core:archive command is executed. * * ### Examples * diff --git a/core/Url.php b/core/Url.php index f5814aaeec2..df60c388d1c 100644 --- a/core/Url.php +++ b/core/Url.php @@ -305,7 +305,7 @@ static public function getHost($checkIfTrusted = true) } /** - * Sets the host. Useful for CLI scripts, eg. archive.php + * Sets the host. Useful for CLI scripts, eg. core:archive command * * @param $host string */ diff --git a/lang/en.json b/lang/en.json index 0d59b3a7174..dcc12af522e 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1548,7 +1548,7 @@ "AddANDorORCondition": "Add %s condition", "AddNewSegment": "Add new segment", "AreYouSureDeleteSegment": "Are you sure you want to delete this segment?", - "AutoArchivePreProcessed": "segmented reports are pre-processed (faster, requires archive.php cron)", + "AutoArchivePreProcessed": "segmented reports are pre-processed (faster, requires cron)", "AutoArchiveRealTime": "segmented reports are processed in real time", "ChooseASegment": "Choose a segment", "DataAvailableAtLaterDate": "Your segmented analytics reports will be available later. We apologize for the inconvenience.", @@ -2051,7 +2051,7 @@ "UnsupportedArchiveType": "Encountered unsupported archive type %1$s.", "UpdaterHasNotBeenRun": "The updater has never been run.", "UpdaterIsNotScheduledToRun": "It is not scheduled to run in the future.", - "UpdaterScheduledForNextRun": "It is scheduled to run during the next archive.php cron execution.", + "UpdaterScheduledForNextRun": "It is scheduled to run during the next cron core:archive command execution.", "UpdaterWasLastRun": "The updater was last run on %s.", "UpdaterWillRunNext": "It is next scheduled to run on %s.", "WidgetLocation": "Visitor Location" diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php index 94aa0491ca4..a14c74d5e6c 100644 --- a/plugins/CoreAdminHome/API.php +++ b/plugins/CoreAdminHome/API.php @@ -37,7 +37,7 @@ public function runScheduledTasks() } /* - * stores the list of websites IDs to re-reprocess in archive.php + * stores the list of websites IDs to re-reprocess in core:archive command */ const OPTION_INVALIDATED_IDSITES = 'InvalidatedOldReports_WebsiteIds'; @@ -51,7 +51,7 @@ public function runScheduledTasks() * to be reprocessed by visiting the script as the Super User: * http://example.net/piwik/misc/cron/archive.php?token_auth=$SUPER_USER_TOKEN_AUTH_HERE * REQUIREMENTS: On large piwik setups, you will need in PHP configuration: max_execution_time = 0 - * We recommend to use an hourly schedule of the script at misc/cron/archive.php + * We recommend to use an hourly schedule of the script. * More information: http://piwik.org/setup-auto-archiving/ * * @param string $idSites Comma separated list of idSite that have had data imported for the specified dates @@ -160,7 +160,7 @@ public function invalidateArchivedReports($idSites, $dates) } \Piwik\Plugins\SitesManager\API::getInstance()->updateSiteCreatedTime($idSites, $minDate); - // Force to re-process data for these websites in the next archive.php cron run + // Force to re-process data for these websites in the next cron core:archive command run $invalidatedIdSites = self::getWebsiteIdsToInvalidate(); $invalidatedIdSites = array_merge($invalidatedIdSites, $idSites); $invalidatedIdSites = array_unique($invalidatedIdSites); @@ -183,7 +183,7 @@ public function invalidateArchivedReports($idSites, $dates) } /** - * Returns array of idSites to force re-process next time archive.php runs + * Returns array of idSites to force re-process next time core:archive command runs * * @ignore * @return mixed diff --git a/tests/PHPUnit/Integration/ArchiveCronTest.php b/tests/PHPUnit/Integration/ArchiveCronTest.php index 9d11eb373c4..71c8b259fde 100644 --- a/tests/PHPUnit/Integration/ArchiveCronTest.php +++ b/tests/PHPUnit/Integration/ArchiveCronTest.php @@ -10,7 +10,7 @@ use Piwik\Plugins\SitesManager\API; /** - * Tests to call the archive.php cron script and check there is no error, + * Tests to call the cron core:archive command script and check there is no error, * Then call the API testing for "Browser archiving is disabled" (see disableArchiving) * This tests that, when archiving is disabled, * then Piwik API will return data that was pre-processed during archive.php run diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI index 8c15feb00dd..aeeec60d996 160000 --- a/tests/PHPUnit/UI +++ b/tests/PHPUnit/UI @@ -1 +1 @@ -Subproject commit 8c15feb00dd40880d1872680cb84b330fd56c6ff +Subproject commit aeeec60d996fb1b5f70f1663750c5eefb861f50e diff --git a/tests/PHPUnit/proxy/includes.php b/tests/PHPUnit/proxy/includes.php index a2d80f6e067..0ffce4642b2 100644 --- a/tests/PHPUnit/proxy/includes.php +++ b/tests/PHPUnit/proxy/includes.php @@ -17,7 +17,7 @@ \Piwik\SettingsServer::setMaxExecutionTime(0); -// Make sure Data processed in archive.php is not being purged instantly (useful for: Integration/ArchiveCronTest) +// Make sure Data processed in cron core:archive command is not being purged instantly (useful for: Integration/ArchiveCronTest) if(\Piwik\SettingsServer::isArchivePhpTriggered()) { \Piwik\ArchiveProcessor\Rules::$purgeDisabledByTests = true; } \ No newline at end of file