0

我正在尝试从主应用程序引导文件将模型放入 Zend Registry:

public function _initRegistry()
{
    $this->bootstrap('db'); 

    $processmanager = new Systems_Model_Process();
    Zend_Registry::set('processmanager', $processmanager);
}

出于某种原因,我遇到了以下错误:

Warning: include_once(Systems/Model/Process.php) [function.include-once]: failed to open stream: No such file or directory in /home/planetxg/public_html/dash/library/Zend/Loader.php on line 146

Warning: include_once() [function.include]: Failed opening 'Systems/Model/Process.php' for inclusion (include_path='/home/planetxg/public_html/dash/application/../library:/home/planetxg/public_html/dash/library:.:/usr/lib/php:/usr/local/lib/php') in /home/planetxg/public_html/dash/library/Zend/Loader.php on line 146

Fatal error: Class 'Systems_Model_Process' not found in /home/planetxg/public_html/dash/application/Bootstrap.php on line 20

有问题的模型位于以下位置:

application/modules/Systems/models/Process.php

是否有一些简单的东西我错过了或根本没有设置在这里?在控制器中正常调用模型时,我应该添加一切正常。

如果有帮助,这是我的主要 ini 块:

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
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.frontController.actionHelperPaths.Utilities = APPLICATION_PATH "/controllers/Helpers"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = 
autoloaderNamespaces[] = "CreativeLaunch_"
autoloaderNamespaces[] = "Systems_"
4

1 回答 1

1

您需要一个application/modules/systems/Bootstrap.php扩展模块引导类Zend_Application_Module_Bootstrap。这将设置模块自动加载。此外,您的模块文件夹应该是小写的 - application/modules/systems

模块资源需要_initRegistry在主引导文件中的方法之前运行,因此将该方法的第一行更改为:

$this->bootstrap(array('db', 'modules'));

其他一切看起来都不错。

于 2013-01-15T14:32:02.940 回答