confs[$this->_normalizeConfName($name)] = $conf; } function getConf($name) { $name = $this->_normalizeConfName($name); if(isset($this->confs[$name])) return $this->confs[$name]; $ext = substr($name, strpos($name, '.')); if($ext == '.ini') { $file = $this->_locateFile($name); if(defined('LIMB_VAR_DIR')) $this->confs[$name] = new lmbCachedIni($file, LIMB_VAR_DIR . '/ini/'); else $this->confs[$name] = new lmbIni($file); } elseif($ext == '.conf.php') { $this->confs[$name] = new lmbConf($this->_locateFile($name)); } else throw new lmbException("'$ext' type configuration is not supported!"); return $this->confs[$name]; } protected function _locateFile($name) { return $this->toolkit->findFileAlias($name, LIMB_CONF_INCLUDE_PATH, 'config'); } protected function _normalizeConfName($name) { if(strpos($name, '.') !== false) return $name; return "$name.conf.php"; } } ?>