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:
authorThomas Steur <thomas.steur@googlemail.com>2014-02-05 06:12:37 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-02-05 06:12:37 +0400
commitd9f08bdc401f7d8355fae91d27c2548669329d15 (patch)
tree19d9ee0056e294b4d065c9b8e9f1277ae5b39e14
parent3ff56cefa5825cbcf37553621ccc189de121e5e3 (diff)
fixes #4612 do not bootstrap complete CronArchive when we just want to run scheduled tasks
-rw-r--r--core/CronArchive.php19
-rw-r--r--core/Tracker.php6
2 files changed, 13 insertions, 12 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php
index 4c38e6d7f6..a83fb2062c 100644
--- a/core/CronArchive.php
+++ b/core/CronArchive.php
@@ -116,7 +116,6 @@ Notes:
private $acceptInvalidSSLCertificate = false;
private $lastSuccessRunTimestamp = false;
private $errors = array();
- private $isTrackerMode = false;
/**
* Returns the option name of the option that stores the time the archive.php script was last run.
@@ -158,6 +157,17 @@ Notes:
}
}
+ public function runScheduledTasksInTrackerMode()
+ {
+ $this->initPiwikHost();
+ $this->initLog();
+ $this->initCore();
+ $this->initTokenAuth();
+ $this->logInitInfo();
+ $this->checkPiwikUrlIsValid();
+ $this->runScheduledTasks();
+ }
+
/**
* Main function, runs archiving on all websites with new activity
*/
@@ -420,11 +430,6 @@ Notes:
exit(1);
}
- public function enableTrackerMode()
- {
- $this->isTrackerMode = true;
- }
-
public function runScheduledTasks()
{
$this->logSection("SCHEDULED TASKS");
@@ -717,7 +722,7 @@ Notes:
*/
private function initCheckCli()
{
- if (Common::isPhpCliMode() || $this->isTrackerMode) {
+ if (Common::isPhpCliMode()) {
return;
}
$token_auth = Common::getRequestVar('token_auth', '', 'string');
diff --git a/core/Tracker.php b/core/Tracker.php
index e5d8ca6bf7..46e1f68d36 100644
--- a/core/Tracker.php
+++ b/core/Tracker.php
@@ -332,15 +332,11 @@ class Tracker
ob_start();
CronArchive::$url = Common::sanitizeInputValue(Url::getCurrentUrlWithoutFileName());
$cronArchive = new CronArchive();
- $cronArchive->enableTrackerMode();
- $cronArchive->init();
- $cronArchive->runScheduledTasks();
+ $cronArchive->runScheduledTasksInTrackerMode();
$resultTasks = ob_get_contents();
ob_clean();
- /* $resultTasks = TaskScheduler::runTasks(); */
-
// restore original user privilege
Piwik::setUserHasSuperUserAccess($isSuperUser);