Skip to content
Extraits de code Groupes Projets
Valider 0e63a76e rédigé par robocoder's avatar robocoder
Parcourir les fichiers

fixes #1320 - output tracking pixel at start of request to increase perceived...

fixes #1320 - output tracking pixel at start of request to increase perceived tracker responsiveness

the tradeoff is the loss of some user-readable text in non-debug mode for empty requests and exceptions

(arguably, we probably shouldn't have been outputing e->getMessage() in non-debug mode)



git-svn-id: http://dev.piwik.org/svn/trunk@6539 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 2dcf64f6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -149,6 +149,8 @@ class Piwik_Tracker ...@@ -149,6 +149,8 @@ class Piwik_Tracker
*/ */
public function main() public function main()
{ {
$this->outputTransparentGif();
if (!empty($this->requests)) if (!empty($this->requests))
{ {
// handle all visits // handle all visits
...@@ -232,19 +234,16 @@ class Piwik_Tracker ...@@ -232,19 +234,16 @@ class Piwik_Tracker
{ {
case self::STATE_LOGGING_DISABLE: case self::STATE_LOGGING_DISABLE:
printDebug("Logging disabled, display transparent logo"); printDebug("Logging disabled, display transparent logo");
$this->outputTransparentGif();
break; break;
case self::STATE_EMPTY_REQUEST: case self::STATE_EMPTY_REQUEST:
printDebug("Empty request => Piwik page"); printDebug("Empty request => Piwik page");
echo "<a href='/'>Piwik</a> is a free open source <a href='http://piwik.org'>web analytics</a> alternative to Google analytics.";
break; break;
case self::STATE_NOSCRIPT_REQUEST: case self::STATE_NOSCRIPT_REQUEST:
case self::STATE_NOTHING_TO_NOTICE: case self::STATE_NOTHING_TO_NOTICE:
default: default:
printDebug("Nothing to notice => default behaviour"); printDebug("Nothing to notice => default behaviour");
$this->outputTransparentGif();
break; break;
} }
printDebug("End of the page."); printDebug("End of the page.");
...@@ -620,21 +619,16 @@ if(!function_exists('printDebug')) ...@@ -620,21 +619,16 @@ if(!function_exists('printDebug'))
function Piwik_Tracker_ExitWithException($e) function Piwik_Tracker_ExitWithException($e)
{ {
Piwik_Common::sendHeader('Content-Type: text/html; charset=utf-8'); Piwik_Common::sendHeader('Content-Type: text/html; charset=utf-8');
if(isset($GLOBALS['PIWIK_TRACKER_DEBUG']) && $GLOBALS['PIWIK_TRACKER_DEBUG']) if(isset($GLOBALS['PIWIK_TRACKER_DEBUG']) && $GLOBALS['PIWIK_TRACKER_DEBUG'])
{ {
$trailer = '<font color="#888888">Backtrace:<br /><pre>'.$e->getTraceAsString().'</pre></font>'; $trailer = '<font color="#888888">Backtrace:<br /><pre>'.$e->getTraceAsString().'</pre></font>';
} $headerPage = file_get_contents(PIWIK_INCLUDE_PATH . '/themes/default/simple_structure_header.tpl');
else $footerPage = file_get_contents(PIWIK_INCLUDE_PATH . '/themes/default/simple_structure_footer.tpl');
{ $headerPage = str_replace('{$HTML_TITLE}', 'Piwik &rsaquo; Error', $headerPage);
$trailer = '<p>Edit the following line in piwik.php to enable tracker debugging and display a backtrace:</p>
<blockquote><pre>$GLOBALS[\'PIWIK_TRACKER_DEBUG\'] = true;</pre></blockquote>';
}
$headerPage = file_get_contents(PIWIK_INCLUDE_PATH . '/themes/default/simple_structure_header.tpl');
$footerPage = file_get_contents(PIWIK_INCLUDE_PATH . '/themes/default/simple_structure_footer.tpl');
$headerPage = str_replace('{$HTML_TITLE}', 'Piwik &rsaquo; Error', $headerPage);
echo $headerPage . '<p>' . $e->getMessage() . '</p>' . $trailer . $footerPage; echo $headerPage . '<p>' . $e->getMessage() . '</p>' . $trailer . $footerPage;
}
exit; exit;
} }
......
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