简体   繁体   中英

Zend Framework Plugin in INI is not run

The plugin declared in my application.ini file is not being triggered. I can install plugins the old way via the Bootstrap file, but I'd prefer to keep it in the INI. It doesn't ever load that file, no exception thrown, nothing.

I've tried adding .class to the declaration, but nothing.

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

Have you registered the 'Faxxbachs_Plugins' namespace as a plugin path?

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

Also FYI, I noticed in your example, you were inconsistent in your casing of frontController . ZF tends gets whiny about case, so make sure you're consistent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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