开发者

Is it possible to configure custom plugin directories for Zend?

开发者 https://www.devze.com 2022-12-16 10:47 出处:网络
I want to be able to store custom plugins in the library folder of my application (currently I am storing them in the Zend library itself). Is there a way of providing additional plugin开发者_高级运维

I want to be able to store custom plugins in the library folder of my application (currently I am storing them in the Zend library itself). Is there a way of providing additional plugin开发者_高级运维 directories in the application.ini file?


I figured this one out:

Create a folder in:

 application/library/PREFIX

(where PREFIX is the class prefix for your plugin, and it's root directory)

In the application.ini file - add:

 autoloaderNamespaces[] = "PREFIX"

add this line to register the plugin with the Front Controller

 resources.frontController.plugins.PluginName= "PREFIX_PluginName"

If you need/want to organise your plugin folders - use the Zend underscore = directories naming convention - so this:

resources.frontController.plugins.PluginName= "PREFIX_Path_To_Folder_PluginName"

would refer to a class called:

PREFIX_Path_To_Folder_PluginName 

in a file called: "PluginName.php"

in directory:

application/library/PREFIX/Path/To/Folder/PluginName.php

Hope that helps anyone who needs to ask this question

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号