简体   繁体   English

INI中的Zend Framework插件未运行

[英]Zend Framework Plugin in INI is not run

The plugin declared in my application.ini file is not being triggered. 我的application.ini文件中声明的插件未触发。 I can install plugins the old way via the Bootstrap file, but I'd prefer to keep it in the INI. 我可以通过Bootstrap文件以旧方式安装插件,但我希望将其保留在INI中。 It doesn't ever load that file, no exception thrown, nothing. 它永远不会加载该文件,不会引发异常,什么也不会。

I've tried adding .class to the declaration, but nothing. 我尝试将.class添加到声明中,但是什么也没有。

application.ini

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
phpSettings.date.timezone = "America/Chicago"

includePaths.library = APPLICATION_PATH "/../library:/Users/shane/Sites/doctrine1/lib"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
;resources.modules = ""

resources.frontcontroller.defaultmodule = default
resources.frontcontroller.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.params.displayExceptions = 1
resources.doctrine.connections.default.dsn = "mysql://root:root@127.0.0.1/newfb"
resources.doctrine.manager.attributes.attr_model_loading = "model_loading_zend"
;resources.doctrine.manager.attributes.attr_use_native_enum = true
pluginpaths.ZFDoctrine_Application_Resource = "ZFDoctrine/Application/Resource"
autoloadernamespaces.0 = "Doctrine"
autoloadernamespaces.1 = "ZFDoctrine"
autoloadernamespaces.2 = "dummy"
autoloadernamespaces.3 = "ZFDebug"

resources.frontController.params.prefixDefaultModule = false

;; This should work, but it doesn't, not sure why
resources.frontController.plugins.messages = "dummy_Plugins_Messages"

library/dummy/Plugins/Messages.php

<?php

class dummy_Plugins_Messages extends Zend_Controller_Plugin_Abstract
{
public function  preDispatch(Zend_Controller_Request_Abstract $request) {
    parent::preDispatch($request);

    throw new Exception('HERE');

}

} }

The index.php is the standard Zend_Application created using the Zend_Tool index.php是使用Zend_Tool创建的标准Zend_Application。

Have you registered the 'Faxxbachs_Plugins' namespace as a plugin path? 您是否已将“ Faxxbachs_Plugins”名称空间注册为插件路径?

pluginpaths.Faxxbachs_Plugins = /path/to/Faxxbachs/Plugins

Also FYI, I noticed in your example, you were inconsistent in your casing of frontController . 同样,仅供参考,我在您的示例中注意到,您对frontController不一致。 ZF tends gets whiny about case, so make sure you're consistent. 采埃孚(ZF)往往会抱怨案件,因此请确保您保持一致。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM