/**
* Инициализация конфигурации
*/
protected function _initConfig()
{
$path = APPLICATION_PATH . '/../library/Zkernel/Application/configs';
$config = new Zend_Config(array(), true);
$it = new DirectoryIterator($path);
foreach ($it as $file) {
if ($file->isFile()) {
$fullpath = $path . '/' . $file;
switch (substr(trim(strtolower($fullpath)), -3)) {
case 'ini':
$cfg = new Zend_Config_Ini($fullpath, $this->getEnvironment());
break;
case 'xml':
$cfg = new Zend_Config_Xml($fullpath, $this->getEnvironment());
break;
default:
throw new Zend_Config_Exception('Invalid format for config file');
break;
}
$config->merge($cfg);
}
}
$config->merge(new Zend_Config($this->getOptions()));
$this->setOptions($config->toArray());
}