diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-01-31 06:44:51 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-01-31 06:44:51 +0400 |
commit | 4bc46c347e19bc032861aa37cf903a250f247a78 (patch) | |
tree | f98f26752838945fd5ca1a8cfddefffe5d2ce90e /misc | |
parent | b0fb01781f2d509975dd58e535d7e5d9f103d599 (diff) |
refs #4564 we have to get the token from the piwik_tests database
Diffstat (limited to 'misc')
-rw-r--r-- | misc/cron/updatetoken.php | 5 | ||||
-rwxr-xr-x | misc/log-analytics/import_logs.py | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/misc/cron/updatetoken.php b/misc/cron/updatetoken.php index 351d980c1d..f7cba2ab20 100644 --- a/misc/cron/updatetoken.php +++ b/misc/cron/updatetoken.php @@ -29,6 +29,11 @@ if (!Common::isPhpCliMode()) { return; } +$testmode = in_array('--testmode', $_SERVER['argv']); +if ($testmode) { + Config::getInstance()->setTestEnvironment(); +} + $token = Db::get()->fetchOne("SELECT token_auth FROM " . Common::prefixTable("user") . " WHERE superuser_access = 1 diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py index 14443a7cb0..29f5447a19 100755 --- a/misc/log-analytics/import_logs.py +++ b/misc/log-analytics/import_logs.py @@ -490,6 +490,10 @@ class Configuration(object): help="Make URL path lowercase so paths with the same letters but different cases are " "treated the same." ) + option_parser.add_option( + '--enable-testmode', dest='enable_testmode', default=False, action='store_true', + help="If set, it will try to get the token_auth from the piwik_tests directory" + ) return option_parser @@ -592,7 +596,12 @@ class Configuration(object): os.path.join(os.path.dirname(__file__), '../../misc/cron/updatetoken.php'), ) - filename = subprocess.check_output("php " + updatetokenfile, shell=True); + + process = "php " + updatetokenfile + if self.options.enable_testmode: + process = process + " --testmode" + + filename = subprocess.check_output(process, shell=True); credentials = open(filename, 'r').readline() credentials = credentials.split('\t') return credentials[1] |