Where to put plugins in a Zend Framework website

2020-03-02 05:06发布

问题:

The question is quite simple : I have a controller plugin for Zend Framework.

Should I put it in the "library/Plugin" folder, or in "application/plugins".

(btw for now it is in library/Plugin but this works on Linux and Mac Os X, but not Windows so i figured maybe that is not the right place)

Thank you

回答1:

If its a controller plugin it goes in "application/plugins".
If it's a general purpose plugin (ie Utility Classes and such) it goes in /library/*, where * follows the Zend Loader rules.



回答2:

I generally put everything that is specific to my application, e.g. not reusable without modification into the appropriate application folder.

For generic plugins, I create a new folder in library. This folder is modeled after the Zend library folder concerning names, e.g. My/Controller/Action/Helper or My/Controller/Plugin, etc. Putting stuff there is optional though, as you might as well put this in the appropriate application folder as well. I just like the distinction.

I never put anything into the standard Zend distribution. This would get lost when updating.