关于Config
时间:2010-03-31 来源:bing_fox
1. 简介
配置文件类, 配置文件格式可以是ini, xml等
2. Section 片段
[DB]
db.adapter = PDO_MYSQL
db.config.host = localhost
db.config.username = jack
db.config.password = 111111
db.config.dbname = zftest
db.config.port = 3306 ===调用ini配置文件
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/application.ini', 'DB');
$driver = $config->db->adapter;
$para3 = array( 'host'=>$config->db->config->host,
'username'=>$config->db->config->username,
'password'=>$config->db->config->password,
'dbname'=>$config->db->config->dbname,
'port'=>$config->db->config->port
);
===
配置文件类, 配置文件格式可以是ini, xml等
2. Section 片段
[DB]
db.adapter = PDO_MYSQL
db.config.host = localhost
db.config.username = jack
db.config.password = 111111
db.config.dbname = zftest
db.config.port = 3306 ===调用ini配置文件
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/application.ini', 'DB');
$driver = $config->db->adapter;
$para3 = array( 'host'=>$config->db->config->host,
'username'=>$config->db->config->username,
'password'=>$config->db->config->password,
'dbname'=>$config->db->config->dbname,
'port'=>$config->db->config->port
);
===
相关阅读 更多 +