我的application.ini看起来是这样的:Zend的模块不加载库
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules = ""
resourceses.includePaths.library = APPLICATION_PATH "/../../library"
resources.layout.layout = layout
admin.resources.layout.layout = admin
的index.php看起来像这样
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../../library'),
APPLICATION_PATH . '/modules/admin/models',
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
我的应用程序/ bootstrap.php中看起来是这样的:
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initAutoload() {
$autoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'Admin_',
'basePath' => dirname(__FILE__) . '/modules/admin'
));
}
}
最后我的模块Bootstrap看起来像这样:
<?php
class admin_Bootstrap extends Zend_Application_Module_Bootstrap {
}
我正在尝试开发和管理员模块。我已将它设置在文件夹应用程序/模块下。我得到这个错误:
Warning: include_once(Zend\Paginator\Adapter\Select.php) [function.include-once]: failed to open stream: No such file or directory in E:\wamp\www\industrial\library\Zend\Loader.php on line 146
Warning: include_once() [function.include]: Failed opening 'Zend\Paginator\Adapter\Select.php' for inclusion (include_path='E:\wamp\www\industrial\application/../library;;E:\wamp\www\industrial\application/modules/admin/models;E:\wamp\www\industrial\library;.;C:\php5\pear') in E:\wamp\www\industrial\library\Zend\Loader.php on line 146
Fatal error: Class 'Zend_Paginator_Adapter_Select' not found in E:\wamp\www\industrial\application\modules\admin\controllers\UsersController.php on line 11
不明白什么是错的。 PS:我已经使用this教程来设置模块