diff options
author | matthieu_ <matthieu_@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2007-09-19 16:19:09 +0400 |
---|---|---|
committer | matthieu_ <matthieu_@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2007-09-19 16:19:09 +0400 |
commit | 0a20bb45e102d49a8e7e404b4c505f0b14370128 (patch) | |
tree | adb4842d6fb930054cdd2629c1f58330b317df2b /modules | |
parent | b3abdd6555944d0ebf3d0a503498cf0d810d4c3d (diff) |
Added piwik release timeline to the TODO file + organized tasks
Changed config class so that it uses 2 config files now (one default and one user specific where you can setup new values for the settings)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/API/Request.php | 2 | ||||
-rwxr-xr-x | modules/Config.php | 42 | ||||
-rw-r--r-- | modules/DataTable/Renderer/CSV.php | 2 | ||||
-rwxr-xr-x | modules/ErrorHandler.php | 8 | ||||
-rw-r--r-- | modules/ExceptionHandler.php | 5 |
5 files changed, 49 insertions, 10 deletions
diff --git a/modules/API/Request.php b/modules/API/Request.php index 7f45ba91ff..1380139c9d 100644 --- a/modules/API/Request.php +++ b/modules/API/Request.php @@ -288,7 +288,7 @@ class Piwik_API_Request ), 'Sort' => array( 'filter_sort_column' => array('string', Piwik_Archive::INDEX_NB_VISITS), - 'filter_sort_order' => array('string', 'desc'), + 'filter_sort_order' => array('string', Zend_Registry::get('config')->General->dataTable_default_sort_order), ), 'Limit' => array( 'filter_offset' => array('integer', '0'), diff --git a/modules/Config.php b/modules/Config.php index a228312c78..c48f32be29 100755 --- a/modules/Config.php +++ b/modules/Config.php @@ -5,15 +5,25 @@ */ require_once "Zend/Config/Ini.php"; require_once "Zend/Registry.php"; -class Piwik_Config extends Zend_Config_Ini +class Piwik_Config { - function __construct($pathIniFile = null) + protected $urlToPiwikHelpMissingValueInConfigurationFile = + 'http://piwik.svn.sourceforge.net/viewvc/piwik/trunk/config/global.ini.php'; + + protected $defaultConfig = null; + protected $userConfig = null; + protected $pathIniFileUserConfig = null; + protected $pathIniFileDefaultConfig = null; + + function __construct($pathIniFileUserConfig = null) { - if(is_null($pathIniFile)) + if(is_null($pathIniFileUserConfig)) { - $pathIniFile = PIWIK_INCLUDE_PATH . '/config/config.ini.php'; + $this->pathIniFileUserConfig = PIWIK_INCLUDE_PATH . '/config/config.ini.php'; + $this->pathIniFileDefaultConfig = PIWIK_INCLUDE_PATH . '/config/global.ini.php'; } - parent::__construct($pathIniFile, null, true); + $this->userConfig = new Zend_Config_Ini($this->pathIniFileUserConfig, null, true); + $this->defaultConfig = new Zend_Config_Ini($this->pathIniFileDefaultConfig, null, true); Zend_Registry::set('config', $this); @@ -31,5 +41,27 @@ class Piwik_Config extends Zend_Config_Ini { Zend_Registry::set('tablesPrefix', $this->database->tables_prefix); } + + public function __set($name, $value) + { + $this->userConfig->$name = $value; + } + + public function __get($name) + { + if(null !== ($valueInUserConfig = $this->userConfig->$name)) + { +// return $valueInUserConfig; + } + if(null !== ($valueInDefaultConfig = $this->defaultConfig->$name)) + { + return $valueInDefaultConfig; + } + + throw new Exception("The configuration parameter $name couldn't be found in your configuration file. + <br>Try to replace your default configuration file ({$this->pathIniFileDefaultConfig}) with + the <a href='".$this->urlToPiwikHelpMissingValueInConfigurationFile."'>default piwik configuration file</a> "); + } + } diff --git a/modules/DataTable/Renderer/CSV.php b/modules/DataTable/Renderer/CSV.php index d2e52a0bb0..eb7608b17d 100644 --- a/modules/DataTable/Renderer/CSV.php +++ b/modules/DataTable/Renderer/CSV.php @@ -15,7 +15,7 @@ * The record delimiter string is the carriage return and line feed (<cr><lf>). * The text qualifier string is a quotation mark ("). * If the text contains an embedded delimiter string or qualifier string, the text qualifier is placed around the text, and the embedded qualifier strings are doubled. -* Formatting and layout are ignored. + * Formatting and layout are ignored. */ require_once "DataTable/Renderer/PHP.php"; class Piwik_DataTable_Renderer_CSV extends Piwik_DataTable_Renderer diff --git a/modules/ErrorHandler.php b/modules/ErrorHandler.php index d0dcb81452..db402eb902 100755 --- a/modules/ErrorHandler.php +++ b/modules/ErrorHandler.php @@ -10,8 +10,14 @@ function Piwik_ErrorHandler($errno, $errstr, $errfile, $errline) debug_print_backtrace(); $backtrace = ob_get_contents(); ob_end_clean(); - Zend_Registry::get('logger_error')->log($errno, $errstr, $errfile, $errline, $backtrace); + try { + Zend_Registry::get('logger_error')->log($errno, $errstr, $errfile, $errline, $backtrace); + }catch(Exception $e){ + // in case the error occurs before the logger creation, we simply display it + print("<pre>$errstr \nin '$errfile' at the line $errline\n\n$backtrace\n</pre>"); + exit; + } switch($errno) { case E_ERROR: diff --git a/modules/ExceptionHandler.php b/modules/ExceptionHandler.php index 5d17925841..dc3b057916 100644 --- a/modules/ExceptionHandler.php +++ b/modules/ExceptionHandler.php @@ -10,12 +10,13 @@ function Piwik_ExceptionHandler(Exception $exception) } catch(Exception $e) { print("<br> <b>Exception</b>: '". $exception->getMessage()."'<br>"); - print("Backtrace:<br><pre>"); + print("<br><small>Backtrace:<br><pre>"); print($exception->getTraceAsString()); print("</pre>"); - print("<br> -------------------------- <br> + print("-------------------------- <br> This exception occured and also raised this exception: "); print("'" . $e->getMessage()."'"); + print("</small>"); } } |