开发者

load application.ini

开发者 https://www.devze.com 2023-01-28 17:52 出处:网络
We use: - Zend_Controller_Front - no Zend_Application - no Zend_Application_Bootstrap We want to use application.ini.

We use:

- Zend_Controller_Front

- no Zend_Application

- no Zend_Application_Bootstrap

We 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');
0

精彩评论

暂无评论...
验证码 换一张
取 消