protected static function config($path, $default = NULL, $delimeter = NULL) { if (!isset(static::$_configData)) { static::$_configData = Kohana::$config->load(static::$_configKey)->as_array(); } return Kohana_Arr::path(static::$_configData, $path, $default, $delimeter); }
/** * 加载配置文件 * @return array|bool */ public function getConfigLoad() { $this->_sys = $this->mergeConfig(); $this->_config['sys'] = $this->_sys; $this->hostName = gethostname(); if (array_key_exists('environment', $this->_sys)) { $evn = $this->_sys['environment']; $this->_evn = $this->getEvnName($evn); } $configPath = host() . 'config'; if ($this->_evn) { //获取配置目录的所有文件 $config = $this->getConfigName($configPath . '/' . $this->_evn); if ($config) { $this->_config = array_merge($this->_config, $config); } } else { $this->_config['database'] = $this->getConfigName($configPath . '/' . 'database.php', false); } static::$_configData = $this->_config; return $this->_config; }