diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2008-10-28 14:42:44 +0300 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2008-10-28 14:42:44 +0300 |
commit | 255b887a67c9eb6eaac2ff243b3879756d6cb802 (patch) | |
tree | 40acb631d96976a11160e9f4317cbb47a023c725 /core | |
parent | c1027ca9be90fd572bf6aafc690b7d93e6c75e40 (diff) |
- renaming all instances of LogStats to Tracker for clarity
- improving error message to be prettier
- adding footer in all admin pages for consistency
Diffstat (limited to 'core')
-rw-r--r-- | core/Cookie.php | 2 | ||||
-rw-r--r-- | core/FrontController.php | 2 | ||||
-rw-r--r-- | core/Plugin.php | 2 | ||||
-rw-r--r-- | core/PluginsManager.php | 36 | ||||
-rw-r--r-- | core/Tracker.php (renamed from core/LogStats.php) | 44 | ||||
-rw-r--r-- | core/Tracker/Action.php (renamed from core/LogStats/Action.php) | 22 | ||||
-rw-r--r-- | core/Tracker/Config.php (renamed from core/LogStats/Config.php) | 10 | ||||
-rw-r--r-- | core/Tracker/Db.php (renamed from core/LogStats/Db.php) | 12 | ||||
-rw-r--r-- | core/Tracker/Generator.php (renamed from core/LogStats/Generator.php) | 46 | ||||
-rw-r--r-- | core/Tracker/Generator/Tracker.php (renamed from core/LogStats/Generator/LogStats.php) | 18 | ||||
-rw-r--r-- | core/Tracker/Generator/Visit.php (renamed from core/LogStats/Generator/Visit.php) | 10 | ||||
-rw-r--r-- | core/Tracker/Visit.php (renamed from core/LogStats/Visit.php) | 58 | ||||
-rw-r--r-- | core/Tracker/javascriptTag.tpl (renamed from core/LogStats/javascriptTag.tpl) | 0 | ||||
-rw-r--r-- | core/ViewDataTable.php | 4 | ||||
-rw-r--r-- | core/testMinimumPhpVersion.php | 16 |
15 files changed, 145 insertions, 137 deletions
diff --git a/core/Cookie.php b/core/Cookie.php index 7bcbe7b92c..192ebc3b3b 100644 --- a/core/Cookie.php +++ b/core/Cookie.php @@ -264,7 +264,7 @@ class Piwik_Cookie } -//$c = new Piwik_Cookie( 'piwik_logstats', 86400); +//$c = new Piwik_Cookie( 'piwik_Tracker', 86400); //echo $c; //$c->set(1,1); //$c->set('test',1); diff --git a/core/FrontController.php b/core/FrontController.php index 8d16f31980..6ce8922a31 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -283,7 +283,7 @@ class Piwik_FrontController Piwik::raiseMemoryLimitIfNecessary(); } catch(Exception $e) { - Piwik_ExitWithMessage($e->getMessage()); + Piwik_ExitWithMessage($e->getMessage(), $e->getTraceAsString()); } } diff --git a/core/Plugin.php b/core/Plugin.php index 9d49a19a96..dfd7ff3c88 100644 --- a/core/Plugin.php +++ b/core/Plugin.php @@ -26,7 +26,7 @@ abstract class Piwik_Plugin * 'author_homepage' => string // author homepage (or email "mailto:youremail@example.org") * 'homepage' => string // plugin homepage * 'version' => string // plugin version number - * 'LogStatsPlugin' => bool // should we load this plugin during the stats logging process? + * 'TrackerPlugin' => bool // should we load this plugin during the stats logging process? */ abstract function getInformation(); diff --git a/core/PluginsManager.php b/core/PluginsManager.php index 9d0d422010..c8ae201916 100644 --- a/core/PluginsManager.php +++ b/core/PluginsManager.php @@ -88,15 +88,15 @@ class Piwik_PluginsManager } try{ - $pluginsLogStats = Zend_Registry::get('config')->Plugins_LogStats->Plugins_LogStats; - if(!is_null($pluginsLogStats)) + $pluginsTracker = Zend_Registry::get('config')->Plugins_Tracker->Plugins_Tracker; + if(!is_null($pluginsTracker)) { - $pluginsLogStats = $pluginsLogStats->toArray(); - $key = array_search($pluginName,$pluginsLogStats); + $pluginsTracker = $pluginsTracker->toArray(); + $key = array_search($pluginName,$pluginsTracker); if($key !== false) { - unset($pluginsLogStats[$key]); - Zend_Registry::get('config')->Plugins_LogStats = $pluginsLogStats; + unset($pluginsTracker[$key]); + Zend_Registry::get('config')->Plugins_Tracker = $pluginsTracker; } } } catch(Exception $e) {} @@ -261,7 +261,7 @@ class Piwik_PluginsManager $path = 'plugins/' . $pluginFileName; - // case LogStats, we don't throw the exception, we don't want to add the Zend overhead + // case Tracker, we don't throw the exception, we don't want to add the Zend overhead if(class_exists('Zend_Loader') && !Zend_Loader::isReadable($path)) { @@ -365,7 +365,7 @@ class Piwik_PluginsManager */ private function loadTranslation( $plugin, $langCode ) { - // we are certainly in LogStats mode, Zend is not loaded + // we are certainly in Tracker mode, Zend is not loaded if(!class_exists('Zend_Loader')) { return ; @@ -418,7 +418,7 @@ class Piwik_PluginsManager { if(!class_exists('Zend_Registry')) { - throw new Exception("Not possible to list installed plugins (case LogStats module)"); + throw new Exception("Not possible to list installed plugins (case Tracker module)"); } if(!is_null(Zend_Registry::get('config')->PluginsInstalled->PluginsInstalled)) { @@ -450,22 +450,22 @@ class Piwik_PluginsManager $information = $plugin->getInformation(); // if the plugin is to be loaded during the statistics logging - if(isset($information['LogStatsPlugin']) - && $information['LogStatsPlugin'] === true) + if(isset($information['TrackerPlugin']) + && $information['TrackerPlugin'] === true) { - $pluginsLogStats = Zend_Registry::get('config')->Plugins_LogStats->Plugins_LogStats; - if(is_null($pluginsLogStats)) + $pluginsTracker = Zend_Registry::get('config')->Plugins_Tracker->Plugins_Tracker; + if(is_null($pluginsTracker)) { - $pluginsLogStats = array(); + $pluginsTracker = array(); } else { - $pluginsLogStats = $pluginsLogStats->toArray(); + $pluginsTracker = $pluginsTracker->toArray(); } - if(!in_array($pluginName, $pluginsLogStats)) + if(!in_array($pluginName, $pluginsTracker)) { - $pluginsLogStats[] = $pluginName; - Zend_Registry::get('config')->Plugins_LogStats = $pluginsLogStats; + $pluginsTracker[] = $pluginName; + Zend_Registry::get('config')->Plugins_Tracker = $pluginsTracker; } } } diff --git a/core/LogStats.php b/core/Tracker.php index c0a26c21de..c2a69293c8 100644 --- a/core/LogStats.php +++ b/core/Tracker.php @@ -4,9 +4,9 @@ * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later - * @version $Id: LogStats.php 575 2008-07-26 23:08:32Z matt $ + * @version $Id: Tracker.php 575 2008-07-26 23:08:32Z matt $ * - * @package Piwik_LogStats + * @package Piwik_Tracker */ /** @@ -42,9 +42,9 @@ * Configuration options for the statsLogEngine module: * - use_cookie ; defines if we try to get/set a cookie to help recognize a unique visitor * - * @package Piwik_LogStats + * @package Piwik_Tracker */ -class Piwik_LogStats +class Piwik_Tracker { protected $stateValid; @@ -52,7 +52,7 @@ class Piwik_LogStats /** * - * @var Piwik_LogStats_Db + * @var Piwik_Tracker_Db */ static protected $db = null; @@ -83,7 +83,7 @@ class Piwik_LogStats Piwik_PostEvent('Tracker.createDatabase', $db); if(is_null($db)) { - $configDb = Piwik_LogStats_Config::getInstance()->database; + $configDb = Piwik_Tracker_Config::getInstance()->database; // we decode the password. Password is html encoded because it's enclosed between " double quotes $configDb['password'] = htmlspecialchars_decode($configDb['password']); @@ -93,7 +93,7 @@ class Piwik_LogStats $configDb['port'] = '3306'; } - $db = new Piwik_LogStats_Db( $configDb['host'], + $db = new Piwik_Tracker_Db( $configDb['host'], $configDb['username'], $configDb['password'], $configDb['dbname'], @@ -119,17 +119,17 @@ class Piwik_LogStats private function initProcess() { try{ - $pluginsLogStats = Piwik_LogStats_Config::getInstance()->Plugins_LogStats; - if(is_array($pluginsLogStats) - && count($pluginsLogStats) != 0) + $pluginsTracker = Piwik_Tracker_Config::getInstance()->Plugins_Tracker; + if(is_array($pluginsTracker) + && count($pluginsTracker) != 0) { Piwik_PluginsManager::getInstance()->doNotLoadAlwaysActivatedPlugins(); - Piwik_PluginsManager::getInstance()->setPluginsToLoad( $pluginsLogStats['Plugins_LogStats'] ); + Piwik_PluginsManager::getInstance()->setPluginsToLoad( $pluginsTracker['Plugins_Tracker'] ); } } catch(Exception $e) { } - $saveStats = Piwik_LogStats_Config::getInstance()->LogStats['record_statistics']; + $saveStats = Piwik_Tracker_Config::getInstance()->Tracker['record_statistics']; if($saveStats == 0) { @@ -141,7 +141,7 @@ class Piwik_LogStats $this->setState(self::STATE_NO_GET_VARIABLE); } - $downloadVariableName = Piwik_LogStats_Config::getInstance()->LogStats['download_url_var_name']; + $downloadVariableName = Piwik_Tracker_Config::getInstance()->Tracker['download_url_var_name']; $urlDownload = Piwik_Common::getRequestVar( $downloadVariableName, '', 'string'); if( !empty($urlDownload) ) @@ -153,7 +153,7 @@ class Piwik_LogStats $this->setUrlToRedirect ( $urlDownload); } - $outlinkVariableName = Piwik_LogStats_Config::getInstance()->LogStats['outlink_url_var_name']; + $outlinkVariableName = Piwik_Tracker_Config::getInstance()->Tracker['outlink_url_var_name']; $urlOutlink = Piwik_Common::getRequestVar( $outlinkVariableName, '', 'string'); if( !empty($urlOutlink) ) @@ -193,23 +193,23 @@ class Piwik_LogStats } /** - * Returns the LogStats_Visit object. - * This method can be overwritten so that we use a different LogStats_Visit object + * Returns the Tracker_Visit object. + * This method can be overwritten so that we use a different Tracker_Visit object * - * @return Piwik_LogStats_Visit + * @return Piwik_Tracker_Visit */ protected function getNewVisitObject() { $visit = null; - Piwik_PostEvent('LogStats.getNewVisitObject', $visit); + Piwik_PostEvent('Tracker.getNewVisitObject', $visit); if(is_null($visit)) { - $visit = new Piwik_LogStats_Visit(); + $visit = new Piwik_Tracker_Visit(); } - elseif(!($visit instanceof Piwik_LogStats_Visit_Interface )) + elseif(!($visit instanceof Piwik_Tracker_Visit_Interface )) { - throw new Exception("The Visit object set in the plugin must implement Piwik_LogStats_Visit_Interface"); + throw new Exception("The Visit object set in the plugin must implement Piwik_Tracker_Visit_Interface"); } $visit->setDb(self::$db); @@ -270,7 +270,7 @@ class Piwik_LogStats if($GLOBALS['DEBUGPIWIK'] === true) { - Piwik::printSqlProfilingReportLogStats(self::$db); + Piwik::printSqlProfilingReportTracker(self::$db); } self::disconnectDb(); diff --git a/core/LogStats/Action.php b/core/Tracker/Action.php index effc0409f9..2fc7b322f1 100644 --- a/core/LogStats/Action.php +++ b/core/Tracker/Action.php @@ -6,16 +6,16 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later * @version $Id: Action.php 558 2008-07-20 23:10:38Z matt $ * - * @package Piwik_LogStats + * @package Piwik_Tracker */ /** * Interface of the Action object. * New Action classes can be defined in plugins and used instead of the default one. * - * @package Piwik_LogStats + * @package Piwik_Tracker */ -interface Piwik_LogStats_Action_Interface { +interface Piwik_Tracker_Action_Interface { public function getActionId(); public function record( $idVisit, $idRefererAction, $timeSpentRefererAction ); public function setIdSite( $idSite ); @@ -41,9 +41,9 @@ interface Piwik_LogStats_Action_Interface { * PLUGIN_IDEA - An action hit by a visitor is associated to the HTML title of the page that triggered the action and this HTML title is displayed in the interface * * - * @package Piwik_LogStats + * @package Piwik_Tracker */ -class Piwik_LogStats_Action implements Piwik_LogStats_Action_Interface +class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface { private $actionName; private $url; @@ -59,24 +59,24 @@ class Piwik_LogStats_Action implements Piwik_LogStats_Action_Interface const TYPE_OUTLINK = 2; /** - * @param Piwik_LogStats_Db Database object to be used + * @param Piwik_Tracker_Db Database object to be used */ function __construct( $db ) { $this->actionName = Piwik_Common::getRequestVar( 'action_name', '', 'string'); - $downloadVariableName = Piwik_LogStats_Config::getInstance()->LogStats['download_url_var_name']; + $downloadVariableName = Piwik_Tracker_Config::getInstance()->Tracker['download_url_var_name']; $this->downloadUrl = Piwik_Common::getRequestVar( $downloadVariableName, '', 'string'); - $outlinkVariableName = Piwik_LogStats_Config::getInstance()->LogStats['outlink_url_var_name']; + $outlinkVariableName = Piwik_Tracker_Config::getInstance()->Tracker['outlink_url_var_name']; $this->outlinkUrl = Piwik_Common::getRequestVar( $outlinkVariableName, '', 'string'); - $nameVariableName = Piwik_LogStats_Config::getInstance()->LogStats['download_outlink_name_var']; + $nameVariableName = Piwik_Tracker_Config::getInstance()->Tracker['download_outlink_name_var']; $this->nameDownloadOutlink = Piwik_Common::getRequestVar( $nameVariableName, '', 'string'); $this->url = Piwik_Common::getRequestVar( 'url', '', 'string'); $this->db = $db; - $this->defaultActionName = Piwik_LogStats_Config::getInstance()->LogStats['default_action_name']; + $this->defaultActionName = Piwik_Tracker_Config::getInstance()->Tracker['default_action_name']; } @@ -182,7 +182,7 @@ class Piwik_LogStats_Action implements Piwik_LogStats_Action_Interface */ // get the delimiter, by default '/' - $actionCategoryDelimiter = Piwik_LogStats_Config::getInstance()->General['action_category_delimiter']; + $actionCategoryDelimiter = Piwik_Tracker_Config::getInstance()->General['action_category_delimiter']; // case the name is an URL we dont clean the name the same way if(Piwik_Common::isLookLikeUrl($actionName)) diff --git a/core/LogStats/Config.php b/core/Tracker/Config.php index 65c38d9144..f6e296d02a 100644 --- a/core/LogStats/Config.php +++ b/core/Tracker/Config.php @@ -6,7 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later * @version $Id: Config.php 450 2008-04-20 22:33:27Z matt $ * - * @package Piwik_LogStats + * @package Piwik_Tracker */ /** @@ -14,21 +14,21 @@ * * This is essentially a simple version of Zend_Config that we wrote * because of performance reasons. - * The LogStats module can't afford a dependency with the Zend_Framework. + * The Tracker module can't afford a dependency with the Zend_Framework. * * It's using the php.net/parse_ini_file function to parse the configuration files. * It can be used to access both user config.ini.php and piwik global.ini.php config file. * - * @package Piwik_LogStats + * @package Piwik_Tracker */ -class Piwik_LogStats_Config +class Piwik_Tracker_Config { static private $instance = null; /** * Returns singleton * - * @return Piwik_LogStats_Config + * @return Piwik_Tracker_Config */ static public function getInstance() { diff --git a/core/LogStats/Db.php b/core/Tracker/Db.php index 2f62116bdd..13d23d1a26 100644 --- a/core/LogStats/Db.php +++ b/core/Tracker/Db.php @@ -6,17 +6,17 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later * @version $Id: Db.php 522 2008-06-11 00:31:03Z matt $ * - * @package Piwik_LogStats + * @package Piwik_Tracker */ /** * Simple database PDO wrapper. - * We can't afford to have a dependency with the Zend_Db module in LogStats. + * We can't afford to have a dependency with the Zend_Db module in Tracker. * We wrote this simple class * - * @package Piwik_LogStats + * @package Piwik_Tracker */ -class Piwik_LogStats_Db +class Piwik_Tracker_Db { private $connection = null; private $username; @@ -56,7 +56,7 @@ class Piwik_LogStats_Db * Enables the SQL profiling. * For each query, saves in the DB the time spent on this query. * Very useful to see the slow query under heavy load. - * You can then use Piwik::printSqlProfilingReportLogStats(); + * You can then use Piwik::printSqlProfilingReportTracker(); * to display the SQLProfiling report and see which queries take time, etc. */ static public function enableProfiling() @@ -121,7 +121,7 @@ class Piwik_LogStats_Db { static $prefix; if (!isset($prefix)) { - $prefix = Piwik_LogStats_Config::getInstance()->database['tables_prefix']; + $prefix = Piwik_Tracker_Config::getInstance()->database['tables_prefix']; } return $prefix . $suffix; } diff --git a/core/LogStats/Generator.php b/core/Tracker/Generator.php index dfc6b03052..cd65d1e9f6 100644 --- a/core/LogStats/Generator.php +++ b/core/Tracker/Generator.php @@ -6,7 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later * @version $Id: Generator.php 492 2008-05-23 01:08:12Z matt $ * - * @package Piwik_LogStats + * @package Piwik_Tracker */ /** @@ -33,14 +33,14 @@ * - HTML title * * - * @package Piwik_LogStats - * @subpackage Piwik_LogStats_Generator + * @package Piwik_Tracker + * @subpackage Piwik_Tracker_Generator * * "Le Generator, il est trop Fort!" * - Random fan */ -class Piwik_LogStats_Generator +class Piwik_Tracker_Generator { /** * GET parameters array of values to be used for the current visit @@ -126,7 +126,7 @@ class Piwik_LogStats_Generator // setup database Piwik::createDatabaseObject(); - Piwik_LogStats_Db::enableProfiling(); + Piwik_Tracker_Db::enableProfiling(); $this->timestampToUse = time(); } @@ -218,7 +218,7 @@ class Piwik_LogStats_Generator public function disableProfiler() { $this->profiling = false; - Piwik_LogStats_Db::disableProfiling(); + Piwik_Tracker_Db::disableProfiling(); } /** @@ -229,10 +229,10 @@ class Piwik_LogStats_Generator */ public function end() { - Piwik_LogStats::disconnectDb(); + Piwik_Tracker::disconnectDb(); if($this->profiling) { - Piwik::printSqlProfilingReportLogStats(); + Piwik::printSqlProfilingReportTracker(); } } @@ -285,8 +285,8 @@ class Piwik_LogStats_Generator */ // we get the name of the Download/outlink variables $downloadOrOutlink = array( - Piwik_LogStats_Config::getInstance()->LogStats['download_url_var_name'], - Piwik_LogStats_Config::getInstance()->LogStats['outlink_url_var_name'], + Piwik_Tracker_Config::getInstance()->Tracker['download_url_var_name'], + Piwik_Tracker_Config::getInstance()->Tracker['outlink_url_var_name'], ); // we have a 20% chance to add a download or outlink variable to the URL $this->addParam('piwik_downloadOrOutlink', $downloadOrOutlink); @@ -294,9 +294,9 @@ class Piwik_LogStats_Generator // we get the variables name for the campaign parameters $campaigns = array( - Piwik_LogStats_Config::getInstance()->LogStats['campaign_var_name'], - Piwik_LogStats_Config::getInstance()->LogStats['newsletter_var_name'], - Piwik_LogStats_Config::getInstance()->LogStats['partner_var_name'], + Piwik_Tracker_Config::getInstance()->Tracker['campaign_var_name'], + Piwik_Tracker_Config::getInstance()->Tracker['newsletter_var_name'], + Piwik_Tracker_Config::getInstance()->Tracker['partner_var_name'], ); // we generate a campaign in the URL in 3/18 % of the generated URls $this->addParam('piwik_vars_campaign', $campaigns); @@ -360,7 +360,7 @@ class Piwik_LogStats_Generator { $nbActions = mt_rand(1, $nbActionsMaxPerVisit); - Piwik_LogStats_Generator_Visit::setTimestampToUse($this->getTimestampToUse()); + Piwik_Tracker_Generator_Visit::setTimestampToUse($this->getTimestampToUse()); $this->generateNewVisit(); for($j = 1; $j <= $nbActions; $j++) @@ -420,9 +420,9 @@ class Piwik_LogStats_Generator { // we don't keep the previous action values // reinit them to empty string - $this->setCurrentRequest( Piwik_LogStats_Config::getInstance()->LogStats['download_outlink_name_var'],''); - $this->setCurrentRequest( Piwik_LogStats_Config::getInstance()->LogStats['download_url_var_name'],''); - $this->setCurrentRequest( Piwik_LogStats_Config::getInstance()->LogStats['outlink_url_var_name'],''); + $this->setCurrentRequest( Piwik_Tracker_Config::getInstance()->Tracker['download_outlink_name_var'],''); + $this->setCurrentRequest( Piwik_Tracker_Config::getInstance()->Tracker['download_url_var_name'],''); + $this->setCurrentRequest( Piwik_Tracker_Config::getInstance()->Tracker['outlink_url_var_name'],''); $this->setCurrentRequest( 'action_name', ''); // generate new url referer ; case the visitor stays more than 30min @@ -445,10 +445,10 @@ class Piwik_LogStats_Generator $url .= '?'. $urlVars . '=' . $urlValue; // for a campaign of the CPC kind, we sometimes generate a keyword - if($urlVars == Piwik_LogStats_Config::getInstance()->LogStats['campaign_var_name'] + if($urlVars == Piwik_Tracker_Config::getInstance()->Tracker['campaign_var_name'] && mt_rand(0,1)==0) { - $url .= '&'. Piwik_LogStats_Config::getInstance()->LogStats['campaign_keyword_var_name'] + $url .= '&'. Piwik_Tracker_Config::getInstance()->Tracker['campaign_keyword_var_name'] . '=' . $this->getRandomString(6,3,'ALL');; } } @@ -474,7 +474,7 @@ class Piwik_LogStats_Generator { $nameDownload = $this->getRandomString(6,3,'ALL'); - $this->setCurrentRequest( Piwik_LogStats_Config::getInstance()->LogStats['download_outlink_name_var'] + $this->setCurrentRequest( Piwik_Tracker_Config::getInstance()->Tracker['download_outlink_name_var'] , $nameDownload); } } @@ -648,7 +648,7 @@ class Piwik_LogStats_Generator /** * Saves the visit * - replaces GET and REQUEST by the fake generated request - * - load the LogStats class and call the method to launch the recording + * - load the Tracker class and call the method to launch the recording * * This will save the visit in the database * @@ -657,10 +657,10 @@ class Piwik_LogStats_Generator protected function saveVisit() { $this->setFakeRequest(); - $process = new Piwik_LogStats_Generator_LogStats; + $process = new Piwik_Tracker_Generator_Tracker; $process->main(); } } -require_once "Generator/LogStats.php"; +require_once "Generator/Tracker.php"; require_once "Generator/Visit.php"; diff --git a/core/LogStats/Generator/LogStats.php b/core/Tracker/Generator/Tracker.php index 92a8d29c39..db3ee22272 100644 --- a/core/LogStats/Generator/LogStats.php +++ b/core/Tracker/Generator/Tracker.php @@ -6,20 +6,20 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later * @version $Id: Generator.php 404 2008-03-23 01:09:59Z matt $ * - * @package Piwik_LogStats + * @package Piwik_Tracker */ /** - * Fake Piwik_LogStats that: + * Fake Piwik_Tracker that: * - overwrite the sendHeader method so that no headers are sent. * - doesn't print the 1pixel transparent GIF at the end of the visit process - * - overwrite the logstat_visit object to use so we use our own logstats_visit @see Piwik_LogStats_Generator_Visit + * - overwrite the Tracker Visit object to use so we use our own Tracker_visit @see Piwik_Tracker_Generator_Visit * - * @package Piwik_LogStats - * @subpackage Piwik_LogStats_Generator + * @package Piwik_Tracker + * @subpackage Piwik_Tracker_Generator */ -class Piwik_LogStats_Generator_LogStats extends Piwik_LogStats +class Piwik_Tracker_Generator_Tracker extends Piwik_Tracker { /** * Does nothing instead of sending headers @@ -40,13 +40,13 @@ class Piwik_LogStats_Generator_LogStats extends Piwik_LogStats } /** - * Returns our 'generator home made' Piwik_LogStats_Generator_Visit object. + * Returns our 'generator home made' Piwik_Tracker_Generator_Visit object. * - * @return Piwik_LogStats_Generator_Visit + * @return Piwik_Tracker_Generator_Visit */ protected function getNewVisitObject() { - $visit = new Piwik_LogStats_Generator_Visit(); + $visit = new Piwik_Tracker_Generator_Visit(); $visit->setDb(self::$db); return $visit; } diff --git a/core/LogStats/Generator/Visit.php b/core/Tracker/Generator/Visit.php index 01396d126e..41535f045c 100644 --- a/core/LogStats/Generator/Visit.php +++ b/core/Tracker/Generator/Visit.php @@ -6,19 +6,19 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later * @version $Id: Generator.php 404 2008-03-23 01:09:59Z matt $ * - * @package Piwik_LogStats + * @package Piwik_Tracker */ /** - * Fake Piwik_LogStats_Visit class that overwrite all the Time related method to be able + * Fake Piwik_Tracker_Visit class that overwrite all the Time related method to be able * to setup a given timestamp for the generated visitor and actions. * * - * @package Piwik_LogStats - * @subpackage Piwik_LogStats_Generator + * @package Piwik_Tracker + * @subpackage Piwik_Tracker_Generator */ -class Piwik_LogStats_Generator_Visit extends Piwik_LogStats_Visit +class Piwik_Tracker_Generator_Visit extends Piwik_Tracker_Visit { static protected $timestampToUse; diff --git a/core/LogStats/Visit.php b/core/Tracker/Visit.php index 68714cd129..bf66f07960 100644 --- a/core/LogStats/Visit.php +++ b/core/Tracker/Visit.php @@ -6,11 +6,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later * @version $Id: Visit.php 575 2008-07-26 23:08:32Z matt $ * - * @package Piwik_LogStats + * @package Piwik_Tracker */ -interface Piwik_LogStats_Visit_Interface { +interface Piwik_Tracker_Visit_Interface { function handle(); function setDb($db); } @@ -26,10 +26,10 @@ interface Piwik_LogStats_Visit_Interface { * Whether a visit is NEW or KNOWN we also save the action in the DB. * One request to the piwik.php script is associated to one action. * - * @package Piwik_LogStats + * @package Piwik_Tracker */ -class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface +class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface { protected $cookieLog = null; protected $visitorInfo = array(); @@ -92,7 +92,7 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface protected function isExcluded() { $excluded = 0; - Piwik_PostEvent('LogStats.Visit.isExcluded', $excluded); + Piwik_PostEvent('Tracker.Visit.isExcluded', $excluded); if($excluded) { printDebug("Visitor excluded."); @@ -103,12 +103,12 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface } /** - * Returns the cookie name used for the Piwik LogStats cookie + * Returns the cookie name used for the Piwik Tracker cookie * @return string */ protected function getCookieName() { - return Piwik_LogStats_Config::getInstance()->LogStats['cookie_name'] . $this->idsite; + return Piwik_Tracker_Config::getInstance()->Tracker['cookie_name'] . $this->idsite; } @@ -151,12 +151,12 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface * We make sure all the data that should saved in the cookie is available. */ - if( false !== ($idVisitor = $this->cookieLog->get( Piwik_LogStats::COOKIE_INDEX_IDVISITOR )) ) + if( false !== ($idVisitor = $this->cookieLog->get( Piwik_Tracker::COOKIE_INDEX_IDVISITOR )) ) { - $timestampLastAction = $this->cookieLog->get( Piwik_LogStats::COOKIE_INDEX_TIMESTAMP_LAST_ACTION ); - $timestampFirstAction = $this->cookieLog->get( Piwik_LogStats::COOKIE_INDEX_TIMESTAMP_FIRST_ACTION ); - $idVisit = $this->cookieLog->get( Piwik_LogStats::COOKIE_INDEX_ID_VISIT ); - $idLastAction = $this->cookieLog->get( Piwik_LogStats::COOKIE_INDEX_ID_LAST_ACTION ); + $timestampLastAction = $this->cookieLog->get( Piwik_Tracker::COOKIE_INDEX_TIMESTAMP_LAST_ACTION ); + $timestampFirstAction = $this->cookieLog->get( Piwik_Tracker::COOKIE_INDEX_TIMESTAMP_FIRST_ACTION ); + $idVisit = $this->cookieLog->get( Piwik_Tracker::COOKIE_INDEX_ID_VISIT ); + $idLastAction = $this->cookieLog->get( Piwik_Tracker::COOKIE_INDEX_ID_LAST_ACTION ); if( $timestampLastAction !== false && is_numeric($timestampLastAction) && $timestampFirstAction !== false && is_numeric($timestampFirstAction) @@ -298,7 +298,7 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface protected function isLastActionInTheSameVisit() { return $this->visitorInfo['visit_last_action_time'] - >= ($this->getCurrentTimestamp() - Piwik_LogStats_Config::getInstance()->LogStats['visit_standard_length']); + >= ($this->getCurrentTimestamp() - Piwik_Tracker_Config::getInstance()->Tracker['visit_standard_length']); } /** @@ -359,23 +359,23 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface printDebug("We manage the cookie..."); // idcookie has been generated in handleNewVisit or we simply propagate the old value - $this->cookieLog->set( Piwik_LogStats::COOKIE_INDEX_IDVISITOR, + $this->cookieLog->set( Piwik_Tracker::COOKIE_INDEX_IDVISITOR, $this->visitorInfo['visitor_idcookie'] ); // the last action timestamp is the current timestamp - $this->cookieLog->set( Piwik_LogStats::COOKIE_INDEX_TIMESTAMP_LAST_ACTION, + $this->cookieLog->set( Piwik_Tracker::COOKIE_INDEX_TIMESTAMP_LAST_ACTION, $this->visitorInfo['visit_last_action_time'] ); // the first action timestamp is the timestamp of the first action of the current visit - $this->cookieLog->set( Piwik_LogStats::COOKIE_INDEX_TIMESTAMP_FIRST_ACTION, + $this->cookieLog->set( Piwik_Tracker::COOKIE_INDEX_TIMESTAMP_FIRST_ACTION, $this->visitorInfo['visit_first_action_time'] ); // the idvisit has been generated by mysql in handleNewVisit or simply propagated here - $this->cookieLog->set( Piwik_LogStats::COOKIE_INDEX_ID_VISIT, + $this->cookieLog->set( Piwik_Tracker::COOKIE_INDEX_ID_VISIT, $this->visitorInfo['idvisit'] ); // the last action ID is the current exit idaction - $this->cookieLog->set( Piwik_LogStats::COOKIE_INDEX_ID_LAST_ACTION, + $this->cookieLog->set( Piwik_Tracker::COOKIE_INDEX_ID_LAST_ACTION, $this->visitorInfo['visit_exit_idaction'] ); $this->cookieLog->save(); @@ -467,7 +467,7 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface $returningVisitor = 0; } - $defaultTimeOnePageVisit = Piwik_LogStats_Config::getInstance()->LogStats['default_time_one_page_visit']; + $defaultTimeOnePageVisit = Piwik_Tracker_Config::getInstance()->Tracker['default_time_one_page_visit']; $userInfo = $this->getUserSettingsInformation(); $country = Piwik_Common::getCountry($userInfo['location_browser_lang']); @@ -523,7 +523,7 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface 'location_continent' => $continent, ); - Piwik_PostEvent('LogStats.newVisitorInformation', $informationToSave); + Piwik_PostEvent('Tracker.newVisitorInformation', $informationToSave); $fields = implode(", ", array_keys($informationToSave)); $values = substr(str_repeat( "?,",count($informationToSave)),0,-1); @@ -550,20 +550,20 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface * Returns an object able to handle the current action * Plugins can return an override Action that for example, does not record the action in the DB * - * @return Piwik_LogStats_Action child or fake but with same public interface + * @return Piwik_Tracker_Action child or fake but with same public interface */ protected function getActionObject() { $action = null; - Piwik_PostEvent('LogStats.newAction', $action); + Piwik_PostEvent('Tracker.newAction', $action); if(is_null($action)) { - $action = new Piwik_LogStats_Action( $this->db ); + $action = new Piwik_Tracker_Action( $this->db ); } - elseif(!($action instanceof Piwik_LogStats_Action_Interface)) + elseif(!($action instanceof Piwik_Tracker_Action_Interface)) { - throw new Exception("The Action object set in the plugin must implement the interface Piwik_LogStats_Action_Interface"); + throw new Exception("The Action object set in the plugin must implement the interface Piwik_Tracker_Action_Interface"); } $action->setIdSite($this->idsite); @@ -724,7 +724,7 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface { if(isset($this->currentUrlParse['query'])) { - $newsletterVariableName = Piwik_LogStats_Config::getInstance()->LogStats['newsletter_var_name']; + $newsletterVariableName = Piwik_Tracker_Config::getInstance()->Tracker['newsletter_var_name']; $newsletterVar = Piwik_Common::getParameterFromQueryString( $this->currentUrlParse['query'], $newsletterVariableName); if(!empty($newsletterVar)) @@ -744,7 +744,7 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface { if(isset($this->currentUrlParse['query'])) { - $partnerVariableName = Piwik_LogStats_Config::getInstance()->LogStats['partner_var_name']; + $partnerVariableName = Piwik_Tracker_Config::getInstance()->Tracker['partner_var_name']; $partnerVar = Piwik_Common::getParameterFromQueryString($this->currentUrlParse['query'], $partnerVariableName); if(!empty($partnerVar)) @@ -764,12 +764,12 @@ class Piwik_LogStats_Visit implements Piwik_LogStats_Visit_Interface { if(isset($this->currentUrlParse['query'])) { - $campaignVariableName = Piwik_LogStats_Config::getInstance()->LogStats['campaign_var_name']; + $campaignVariableName = Piwik_Tracker_Config::getInstance()->Tracker['campaign_var_name']; $campaignName = Piwik_Common::getParameterFromQueryString($this->currentUrlParse['query'], $campaignVariableName); if( !empty($campaignName)) { - $campaignKeywordVariableName = Piwik_LogStats_Config::getInstance()->LogStats['campaign_keyword_var_name']; + $campaignKeywordVariableName = Piwik_Tracker_Config::getInstance()->Tracker['campaign_keyword_var_name']; $campaignKeyword = Piwik_Common::getParameterFromQueryString($this->currentUrlParse['query'], $campaignKeywordVariableName); $this->typeRefererAnalyzed = Piwik_Common::REFERER_TYPE_CAMPAIGN; diff --git a/core/LogStats/javascriptTag.tpl b/core/Tracker/javascriptTag.tpl index afcc7d8568..afcc7d8568 100644 --- a/core/LogStats/javascriptTag.tpl +++ b/core/Tracker/javascriptTag.tpl diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php index 2503d23eb5..d367097278 100644 --- a/core/ViewDataTable.php +++ b/core/ViewDataTable.php @@ -455,7 +455,7 @@ abstract class Piwik_ViewDataTable * - etc. * * The values are loaded: - * - from the generic filters that are applied by default @see Piwik_API_Request::getGenericFiltersInformation() + * - from the generic filters that are applied by default @see Piwik_API_ResponseBuilder::getGenericFiltersInformation() * - from the values already available in the GET array * - from the values set using methods from this class (eg. setSearchPattern(), setLimit(), etc.) * @@ -466,7 +466,7 @@ abstract class Piwik_ViewDataTable // build javascript variables to set $javascriptVariablesToSet = array(); - $genericFilters = Piwik_API_Request::getGenericFiltersInformation(); + $genericFilters = Piwik_API_ResponseBuilder::getGenericFiltersInformation(); foreach($genericFilters as $filter) { foreach($filter as $filterVariableName => $filterInfo) diff --git a/core/testMinimumPhpVersion.php b/core/testMinimumPhpVersion.php index 52c7c6d608..1edb46ff87 100644 --- a/core/testMinimumPhpVersion.php +++ b/core/testMinimumPhpVersion.php @@ -38,8 +38,12 @@ if($piwik_zend_compatibility_mode == 1) If you want to use Piwik you need to set <pre>zend.ze1_compatibility_mode = Off</pre> in your php.ini configuration file. You may have to ask your system administrator.</p>"; } -function Piwik_ExitWithMessage($message) +function Piwik_ExitWithMessage($message, $optionalTrace) { + if($optionalTrace) + { + $optionalTrace = '<font color="#888888">Backtrace:<br/><pre>'.$optionalTrace.'</pre></font>'; + } $html = '<html> <head> <title>Piwik › Error</title> @@ -51,9 +55,12 @@ function Piwik_ExitWithMessage($message) color: #000; font-family: Georgia, "Times New Roman", Times, serif; margin-left: 20%; - margin-top: 25px; + margin-top: 50px; margin-right: 20%; - padding: .2em 2em; + padding: 1em 2em; + -moz-border-radius: 12px; + -khtml-border-radius: 12px; + -webkit-border-radius: 12px; } #h1 { color: #006; @@ -77,7 +84,8 @@ function Piwik_ExitWithMessage($message) </head> <body> <span id="h1">Piwik </span><span id="subh1"> # open source web analytics</span> - <p>'.$message.'</p> + <p>'.$message.'</p> + '. $optionalTrace .' <ul> <li><a target="_blank" href="misc/redirectToUrl.php?url=http://piwik.org">Piwik homepage</a></li> <li><a target="_blank" href="misc/redirectToUrl.php?url=http://piwik.org/demo">Piwik demo</a></li> |