/** * Constructor * * This constructor fetches the local configuration path * and constructs the config file for a certain module. * * After having the xml configuration file loaded, it'll create * a Zend_Config_Xml instance and store it in $this->config * * @param string $name The name of the configuration to load */ public function __construct($name) { if (defined('ADMIN_CONF_PATH')) { $config = ADMIN_CONF_PATH; } else { try { $config = Zend_Registry::get('localConfigPath'); } catch (Zend_Exception $e) {} } $this->configFile = $config . $name . '.xml'; $this->configName = $name; /** * @TODO Remove me after the rewrite of the Config Reader. Move this to * Frapi_Internal. I dislike inter-dependencies. */ if ($cachedConfig = Frapi_Internal::getCached('configFile-' . $name)) { $this->config = $cachedConfig; } else { $helper = new Lupin_Config_Helper_XmlArray(); $this->config = $helper->parse($this->configFile); Frapi_Internal::setCached('configFile-' . $name, $this->config); } $this->config = $this->config[$name]; }
/** * Constructor * * This constructor fetches the local configuration path * and constructs the config file for a certain module. * * After having the xml configuration file loaded, it'll create * a Zend_Config_Xml instance and store it in $this->config * * @param string $name The name of the configuration to load */ public function __construct($name) { if (defined('ADMIN_CONF_PATH')) { $config = ADMIN_CONF_PATH; } else { try { $config = Zend_Registry::get('localConfigPath'); } catch (Zend_Exception $e) { } } $this->configFile = $config . $name . '.xml'; $this->configName = $name; $helper = new Lupin_Config_Helper_XmlArray(); $this->config = $helper->parse($this->configFile); $this->config = $this->config[$name]; }