zend config

我们在使用zend(我们用zend1)框架,通常会看见这样的代码

   $config = new Zend_Config_Ini(dirname(dirname(__FILE__)) . '/config.ini', 'production');
   $options = $config->toArray();
   $config = new Zend_Config($options);

看似很简单的功能,框架的作者通过定义Config父类实现通用方法,使用不同子类适配不同格式的配置文件。

同时在类中使用的异常处理值得学习。

猜你喜欢

转载自www.cnblogs.com/kala00k/p/13369162.html