Skip to content
Extraits de code Groupes Projets
Valider a8a2f9bc rédigé par mattab's avatar mattab
Parcourir les fichiers

Refs #4310

parent 18a7ecab
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -170,7 +170,7 @@ class Parameters
$temporary = 'temporary archive';
}
Log::verbose(
"'%s, idSite = %d (%s), segment '%s', report = '%s', UTC datetime [%s -> %s]",
"%s archive, idSite = %d (%s), segment '%s', report = '%s', UTC datetime [%s -> %s]",
$this->getPeriod()->getLabel(),
$this->getSite()->getId(),
$temporary,
......
......@@ -275,9 +275,6 @@ class FrontController extends Singleton
Filechecks::dieIfDirectoriesNotWritable($directoriesToCheck);
self::assignCliParametersToRequest();
if(!empty($_GET['xhprof'])) {
Profiler::setupProfilerXHProf($mainRun = false);
}
Translate::loadEnglishTranslation();
......@@ -289,6 +286,7 @@ class FrontController extends Singleton
$this->handleMaintenanceMode();
$this->handleSSLRedirection();
$this->handleProfiler();
$pluginsManager = \Piwik\Plugin\Manager::getInstance();
$pluginsToLoad = Config::getInstance()->Plugins['Plugins'];
......@@ -492,6 +490,14 @@ class FrontController extends Singleton
}
}
}
private function handleProfiler()
{
if (!empty($_GET['xhprof'])) {
$mainRun = $_GET['xhprof'] == 1; // archive.php sets xhprof=2
Profiler::setupProfilerXHProf($mainRun);
}
}
}
/**
......
......@@ -227,7 +227,7 @@ class Profiler
if($mainRun) {
$runIds = implode(',', $runs);
$out = "\n\nHere is the profiler URL aggregating all runs triggered from this process: ";
$baseUrl = "http://" . $_SERVER['HTTP_HOST'] . "/" . $_SERVER['REQUEST_URI'];
$baseUrl = "http://" . @$_SERVER['HTTP_HOST'] . "/" . @$_SERVER['REQUEST_URI'];
$baseUrlStored = SettingsPiwik::getPiwikUrl();
if(strlen($baseUrlStored) > strlen($baseUrl)) {
$baseUrl = $baseUrlStored;
......@@ -237,7 +237,7 @@ class Profiler
$out .= $baseUrl . "$runIds\n\n";
$out .= "Main run profile:";
$out .= $baseUrl . "$runId\n\n";
Log::info($out);
echo ($out);
} else {
self::setProfilingRunIds($runs);
}
......@@ -247,7 +247,7 @@ class Profiler
private static function setProfilingRunIds($ids)
{
file_put_contents( self::getPathToXHProfRunIds(), json_encode($ids) );
chmod(self::getPathToXHProfRunIds(), 0777);
@chmod(self::getPathToXHProfRunIds(), 0777);
}
private static function getProfilingRunIds()
......
......@@ -632,7 +632,7 @@ class CronArchive
$url = $this->piwikUrl . $url . self::APPEND_TO_API_REQUEST;
if($this->shouldStartProfiler) {
$url .= "&xhprof=1";
$url .= "&xhprof=2";
}
//$this->log($url);
......
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