Skip to content

Commit

Permalink
Do not mention archive.php in the sourcecode, instead mention `./cons…
Browse files Browse the repository at this point in the history
…ole core:archive` command
  • Loading branch information
mattab committed May 11, 2014
1 parent 97402e9 commit c866f47
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 27 deletions.
3 changes: 1 addition & 2 deletions core/Archive.php
Expand Up @@ -100,8 +100,7 @@
*
* <a name="footnote-1"></a>
* [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
Expand Down
4 changes: 2 additions & 2 deletions core/ArchiveProcessor/Rules.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions core/CronArchive.php
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion core/FrontController.php
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/Http.php
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion core/Log.php
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion core/Period/Range.php
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion core/SettingsPiwik.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/SettingsServer.php
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion core/TaskScheduler.php
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion core/Url.php
Expand Up @@ -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
*/
Expand Down
4 changes: 2 additions & 2 deletions lang/en.json
Expand Up @@ -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.",
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions plugins/CoreAdminHome/API.php
Expand Up @@ -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';

Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/Integration/ArchiveCronTest.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/UI
Submodule UI updated from 8c15fe to aeeec6
2 changes: 1 addition & 1 deletion tests/PHPUnit/proxy/includes.php
Expand Up @@ -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;
}

0 comments on commit c866f47

Please sign in to comment.