1
在我的一个项目中(使用Zend框架),我正在从ini文件中检索LDAP配置。我的客户希望将其更改为数据库配置。从数据库加载zend config参数
即,我想从DB读取LDAP配置,然后将其绑定到ini文件中的其他资源参数。有没有办法做到这一点?
在我local.ini文件,我有以下CONFIGS
ldap.server.host = "host"
ldap.server.username = "user"
ldap.server.password = "pwd"
ldap.server.baseDn = "DC=comp,DC=com"
ldap.server.accountDomainName = "abc.intra"
ldap.server.accountDomainNameShort = "dell"
在我的引导
,
protected function _initLocalConfig()
{
$globalConfig = new Zend_Config($this->getOptions(), true);
try {
$localConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/local.ini');
$globalConfig->merge($localConfig);
$this->setOptions($globalConfig->toArray());
} catch (Zend_Config_Exception $e) {
throw new Exception('File /configs/local.ini not found. Create it, it can be empty.');
}
}
谁能告诉我怎么可以检索上面提到的从数据库,然后LDAP PARAMS将它绑定到Zend的配置参数。