在Zendframework中配置多个模块

时间:2013-12-26 12:48:56

标签: zend-framework

我想在zendframework中设置一个多模块,但是在require_once之后它不能在索引文件中工作,并且不会进入application.ini文件。 这是我的index.php代码。

 <?php
defined('BASE_PATH')
|| define('BASE_PATH', realpath(dirname(__FILE__)));

defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', BASE_PATH . '/application');


defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV'):   'production'));

set_include_path(implode(PATH_SEPARATOR, array( 
realpath(APPLICATION_PATH . '/../library'),
APPLICATION_PATH,
APPLICATION_PATH.'/modules',
get_include_path(),
)));

require_once 'Zend/Application.php';

$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH .'/configs/application.ini'
);
print_r(APPLICATION_PATH);die;   


$application->Bootstrap()->run();

 ?>

这是我的application.ini文件代码。

[production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"


resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""
resources.frontController.params.prefixDefaultModule = "1"
resources.frontController.defaultModule = "default"


resources.layout.layout = "layout"
resources.layout.layoutpath = APPLICATION_PATH "/layouts"

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

1 个答案:

答案 0 :(得分:0)

删除die;后的print_r(APPLICATION_PATH);或删除不需要的整行...