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 { $value = html_entity_decode($value); } } } $this->init = true; } /** * Magic get methods catching calls to $config->var_name * Returns the value if found in the * * @param string $name * @return mixed The value requested, usually a string * @throws exception if the value requested not found in both files */ public function __get( $name ) { if(!$this->init) { $this->init(); } $section = array(); if(isset($this->configGlobal[$name])) { $section = array_merge($section, $this->configGlobal[$name]); } if(isset($this->configUser[$name])) { $section = array_merge($section, $this->configUser[$name]); } return count($section) ? $section : null; } }