Lib/Utility/InitConfig.php
public function initConfig($force = false) {
		$pluginName = $this->_getPluginName();
		$checkPath = $this->_getCheckPath();
		$configFile = $this->_getConfigFile();
		$language = (string)Configure::read('Config.language');
		if (!$force && !empty($checkPath) && Configure::check($checkPath)) {
			return;
		}

		// Local config without extra config file
		$conf = $this->getConfig();

		$cachePath = 'static_cfg_' . Inflector::underscore($pluginName) . '_' . $language;
		$cached = Cache::read($cachePath, CAKE_CONFIG_PLUGIN_CACHE_CFG);
		if ($cached !== false) {
			$conf = Hash::mergeDiff($conf, (array)$cached);
			Configure::write($pluginName, $conf);

			return;
		}
		Configure::config('phpcfg', new PhpReader($this->path));
		// Fallback to Plugin config which can be overwritten via local app config.
		Configure::load($pluginName . '.' . $configFile, 'phpcfg', false);
		$defaultConf = $this->getConfig();

		// Local app config
		if (file_exists($this->path . $configFile . '.php')) {
			Configure::load($configFile, 'phpcfg', false);
			$localConf = $this->getConfig();
			$conf = Hash::mergeDiff($conf, $localConf);
		}
		Configure::drop('phpcfg');
		// BC comp:
		$conf = Hash::mergeDiff($conf, $defaultConf);
		Cache::write($cachePath, $conf, CAKE_CONFIG_PLUGIN_CACHE_CFG);
		Configure::write($pluginName, $conf);
	}
public function initConfig($force = false) {
		$pluginName = $this->_getPluginName();
		$checkPath = $this->_getCheckPath();
		$configFile = $this->_getConfigFile();
		$language = (string)Configure::read('Config.language');
		if (!$force && !empty($checkPath) && Configure::check($checkPath)) {
			return;
		}

		// Local config without extra config file
		$conf = $this->getConfig();

		$cachePath = 'static_cfg_' . Inflector::underscore($pluginName) . '_' . $language;
		$cached = Cache::read($cachePath, CAKE_CONFIG_PLUGIN_CACHE_CFG);
		if ($cached !== false) {
			$conf = Hash::mergeDiff($conf, (array)$cached);
			Configure::write($pluginName, $conf);

			return;
		}
		Configure::config('phpcfg', new PhpReader($this->path));
		// Fallback to Plugin config which can be overwritten via local app config.
		Configure::load($pluginName . '.' . $configFile, 'phpcfg', false);
		$defaultConf = $this->getConfig();

		// Local app config
		if (file_exists($this->path . $configFile . '.php')) {
			Configure::load($configFile, 'phpcfg', false);
			$localConf = $this->getConfig();
			$conf = Hash::mergeDiff($conf, $localConf);
		}
		Configure::drop('phpcfg');
		// BC comp:
		$conf = Hash::mergeDiff($conf, $defaultConf);
		Cache::write($cachePath, $conf, CAKE_CONFIG_PLUGIN_CACHE_CFG);
		Configure::write($pluginName, $conf);
	}
public function initConfig ( $ force = false ) { $ pluginName = $ this -> _getPluginName ( ) ; $ checkPath = $ this -> _getCheckPath ( ) ; $ configFile = $ this -> _getConfigFile ( ) ; $ language = ( string ) Configure :: read ( 'Config.language' ) ; if ( ! $ force && ! empty ( $ checkPath ) && Configure :: check ( $ checkPath ) ) { return ; } // Local config without extra config file $ conf = $ this -> getConfig ( ) ; $ cachePath = 'static_cfg_' . Inflector :: underscore ( $ pluginName ) . '_' . $ language ; $ cached = Cache :: read ( $ cachePath , CAKE_CONFIG_PLUGIN_CACHE_CFG ) ; if ( $ cached !== false ) { $ conf = Hash :: mergeDiff ( $ conf , ( array ) $ cached ) ; Configure :: write ( $ pluginName , $ conf ) ; return ; } Configure :: config ( 'phpcfg' , new PhpReader ( $ this -> path ) ) ; // Fallback to Plugin config which can be overwritten via local app config. Configure :: load ( $ pluginName . '.' . $ configFile , 'phpcfg' , false ) ; $ defaultConf = $ this -> getConfig ( ) ; // Local app config if ( file_exists ( $ this -> path . $ configFile . '.php' ) ) { Configure :: load ( $ configFile , 'phpcfg' , false ) ; $ localConf = $ this -> getConfig ( ) ; $ conf = Hash :: mergeDiff ( $ conf , $ localConf ) ; } Configure :: drop ( 'phpcfg' ) ; // BC comp: $ conf = Hash :: mergeDiff ( $ conf , $ defaultConf ) ; Cache :: write ( $ cachePath , $ conf , CAKE_CONFIG_PLUGIN_CACHE_CFG ) ; Configure :: write ( $ pluginName , $ conf ) ; }
Initializes configuration for plugin.

@param bool $force If True, force initialize configuration
@author MGriesbach@gmail.com
@return void
Initializes configuration for plugin .