/** * Cleanup */ protected function end() { switch ($this->getState()) { case self::STATE_LOGGING_DISABLE: printDebug("Logging disabled, display transparent logo"); break; case self::STATE_EMPTY_REQUEST: printDebug("Empty request => Piwik page"); echo "<a href='/'>Piwik</a> is a free open source web <a href='http://piwik.org'>analytics</a> that lets you keep control of your data."; break; case self::STATE_NOSCRIPT_REQUEST: case self::STATE_NOTHING_TO_NOTICE: default: printDebug("Nothing to notice => default behaviour"); break; } printDebug("End of the page."); if ($GLOBALS['PIWIK_TRACKER_DEBUG'] === true) { if (isset(self::$db)) { self::$db->recordProfiling(); Piwik::printSqlProfilingReportTracker(self::$db); } } self::disconnectDatabase(); }
protected function end() { switch ($this->getState()) { case self::STATE_LOGGING_DISABLE: printDebug("Logging disabled, display transparent logo"); $this->outputTransparentGif(); break; case self::STATE_EMPTY_REQUEST: 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; case self::STATE_TO_REDIRECT_URL: $this->sendHeader('Location: ' . $this->getUrlToRedirect()); break; case self::STATE_TRACK_ONLY: printDebug("Data push, tracking only"); break; case self::STATE_NOSCRIPT_REQUEST: case self::STATE_NOTHING_TO_NOTICE: default: printDebug("Nothing to notice => default behaviour"); $this->outputTransparentGif(); break; } printDebug("End of the page."); if ($GLOBALS['PIWIK_TRACKER_DEBUG'] === true) { if (isset(self::$db)) { self::$db->recordProfiling(); Piwik::printSqlProfilingReportTracker(self::$db); } } self::disconnectDatabase(); }