Skip to content
Extraits de code Groupes Projets
Valider 19c46aaa rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Fix TrackerTest.php (includes fix to RequestCommand due to cache use in...

Fix TrackerTest.php (includes fix to RequestCommand due to cache use in UrlHelper::getArrayFromQueryString).
parent 6c021792
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -89,7 +89,7 @@ class RequestCommand extends ConsoleCommand ...@@ -89,7 +89,7 @@ class RequestCommand extends ConsoleCommand
Url::setHost($hostname); Url::setHost($hostname);
$query = $input->getArgument('url-query'); $query = $input->getArgument('url-query');
$query = UrlHelper::getArrayFromQueryString($query); $query = UrlHelper::getArrayFromQueryString($query); // NOTE: this method can create the StaticContainer now
foreach ($query as $name => $value) { foreach ($query as $name => $value) {
$_GET[$name] = $value; $_GET[$name] = $value;
} }
......
...@@ -81,8 +81,7 @@ class ScheduledTasksRunner ...@@ -81,8 +81,7 @@ class ScheduledTasksRunner
$tokens = CronArchive::getSuperUserTokenAuths(); $tokens = CronArchive::getSuperUserTokenAuths();
$tokenAuth = reset($tokens); $tokenAuth = reset($tokens);
$invokeScheduledTasksUrl = SettingsPiwik::getPiwikUrl() $invokeScheduledTasksUrl = "?module=API&format=csv&convertToUnicode=0&method=CoreAdminHome.runScheduledTasks&trigger=archivephp&token_auth=$tokenAuth";
. "?module=API&format=csv&convertToUnicode=0&method=CoreAdminHome.runScheduledTasks&trigger=archivephp&token_auth=$tokenAuth";
$cliMulti = new CliMulti(); $cliMulti = new CliMulti();
$responses = $cliMulti->request(array($invokeScheduledTasksUrl)); $responses = $cliMulti->request(array($invokeScheduledTasksUrl));
......
...@@ -156,6 +156,9 @@ class UrlHelper ...@@ -156,6 +156,9 @@ class UrlHelper
return array(); return array();
} }
// TODO: this method should not use a cache. callers should instead have their own cache, configured through DI.
// one undesirable side effect of using a cache here, is that this method can now init the StaticContainer, which makes setting
// test environment for RequestCommand more complicated.
$cache = Cache::getTransientCache(); $cache = Cache::getTransientCache();
$cacheKey = 'arrayFromQuery' . $urlQuery; $cacheKey = 'arrayFromQuery' . $urlQuery;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter