load application.ini
We use:
- Zend_Controller_Front - no Zend_Application - no Zend_Application_BootstrapWe want to use application.ini.
require_once("Zend/Controller/Front.php");
class Forum4Php_Bootstrap {
protected $_dispatcher;
public function __construct()开发者_如何学运维 {
$this->_dispatcher = Zend_Controller_Front::getInstance();
}
public function runApp() {
$this->_dispatcher->addModuleDirectory(FORUM_FOR_PHP_ROOT_DIR."/application/modules");
$this->_dispatcher->dispatch();
}
}
Is there a way?
You can use parse_ini_file
as karim79 suggested or pass the path to your .ini file to a Zend_Config_Ini
object:
$config = new Zend_Config_Ini('/path/to/application.ini', 'development');
精彩评论