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
path: root/misc/cron
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-04-06 08:50:02 +0300
committerdiosmosis <benaka@piwik.pro>2015-04-06 08:50:02 +0300
commit453663809adef4f64e4a44547c7e96fed280c06c (patch)
tree6ad8de9577721094a332f89b0294d1a41a0fa323 /misc/cron
parentd01ac2028a7877171c7f5a868b2ff2d7ccff14ac (diff)
Update updattoken.php to setup environment correctly and get BlobReportLimitingTest to pass.
Diffstat (limited to 'misc/cron')
-rw-r--r--misc/cron/updatetoken.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/misc/cron/updatetoken.php b/misc/cron/updatetoken.php
index 3e27babc44..43442889af 100644
--- a/misc/cron/updatetoken.php
+++ b/misc/cron/updatetoken.php
@@ -11,7 +11,7 @@
namespace Piwik;
-use Piwik\Container\StaticContainer;
+use Piwik\Application\Environment;
if (!defined('PIWIK_INCLUDE_PATH')) {
define('PIWIK_INCLUDE_PATH', realpath(dirname(__FILE__) . "/../.."));
@@ -49,6 +49,9 @@ function getPiwikDomain()
return null;
}
+$environment = new Environment('cli');
+$environment->init();
+
$piwikDomain = getPiwikDomain();
if($piwikDomain) {
Url::setHost($piwikDomain);
@@ -59,7 +62,7 @@ $token = Db::get()->fetchOne("SELECT token_auth
WHERE superuser_access = 1
ORDER BY date_registered ASC");
-$filename = StaticContainer::get('path.tmp') . '/cache/token.php';
+$filename = $environment->get('path.tmp') . '/cache/token.php';
$content = "<?php exit; //\t" . $token;
file_put_contents($filename, $content);