diff options
Diffstat (limited to 'core/Tracker/Config.php')
-rw-r--r-- | core/Tracker/Config.php | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/core/Tracker/Config.php b/core/Tracker/Config.php index 1fd8a74a19..8d9e6f7499 100644 --- a/core/Tracker/Config.php +++ b/core/Tracker/Config.php @@ -48,36 +48,39 @@ class Piwik_Tracker_Config * @var array */ public $config = array(); - protected $init = false; + protected $initialized = false; public function init($pathIniFileUser = null, $pathIniFileGlobal = null) { + if(is_null($pathIniFileGlobal)) + { + $pathIniFileGlobal = PIWIK_USER_PATH . '/config/global.ini.php'; + } + $this->configGlobal = _parse_ini_file($pathIniFileGlobal, true); + if(is_null($pathIniFileUser)) { $pathIniFileUser = PIWIK_USER_PATH . '/config/config.ini.php'; } - if(is_null($pathIniFileGlobal)) + $this->configUser = _parse_ini_file($pathIniFileUser, true); + if($this->configUser) { - $pathIniFileGlobal = PIWIK_USER_PATH . '/config/global.ini.php'; - } - $this->configUser = parse_ini_file($pathIniFileUser, true); - $this->configGlobal = parse_ini_file($pathIniFileGlobal, true); - - foreach($this->configUser as $section => &$sectionValues) - { - foreach($sectionValues as $name => &$value) - { - if(is_array($value)) - { - $value = array_map("html_entity_decode", $value); - } - else + foreach($this->configUser as $section => &$sectionValues) + { + foreach($sectionValues as $name => &$value) { - $value = html_entity_decode($value); + if(is_array($value)) + { + $value = array_map("html_entity_decode", $value); + } + else + { + $value = html_entity_decode($value); + } } } } - $this->init = true; + $this->initialized = true; } /** @@ -90,7 +93,7 @@ class Piwik_Tracker_Config */ public function __get( $name ) { - if(!$this->init) + if(!$this->initialized) { $this->init(); } |