ZMObject
|
+--ZMPlugins
public class ZMPlugins
extends ZMObject
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
Create new instance. |
|
| Method Summary | |
|---|---|
| array | getAllPlugins(string scope, boolean configured) Get all plugins. |
| static ZMPlugin | getPluginForId(string id, string type) Get plugin for the given id. |
| array | Get a list of available plugin types. |
| static array | getPluginsForType(string type, string scope, boolean configured) Get all plugins for the given type. |
| static ZMPlugin | initPluginForId(string id, boolean forceInit) Init a single plugin. |
| static void | initPlugins(mixed types, string scope) Init all plugins of the given type and scope. |
| static void | instance() Get instance. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public ZMPlugins()
Create new instance. /
public array getAllPlugins(string scope, boolean configured)
Get all plugins.
ZMPlugin::SCOPE_ALL.true, return only configured provider: default is true.ZMPlugin instances grouped by type.public static ZMPlugin getPluginForId(string id, string type)
Get plugin for the given id.
null.public array getPluginTypes()
Get a list of available plugin types.
public static array getPluginsForType(string type, string scope, boolean configured)
Get all plugins for the given type.
ZMPlugin::SCOPE_ALL.true, return only configured provider: default is true.ZMPlugin instances.public static ZMPlugin initPluginForId(string id, boolean forceInit)
Init a single plugin.
This is the single version of initPlugins().
false.null.public static void initPlugins(mixed types, string scope)
Init all plugins of the given type and scope.
public static void instance()
Get instance. /
Plugins.
The plugin type is controlled by the base directory within the plugins directory. Please note that even though it is valid to create payment, shipping and order_total directories/plugins, zen-cart will not (yet) recognize them as such.
For now, plugins are a simple way to add configuration options to zen-cart without the need to write custom installer/uninstaller.Plugins may consist of either:
ZMPlugin..phpwith the same name as the directory in the directory, containing the main plugin class. Again, the classname is expected to be the same as the filename (without the.phpextension). It is the plugins responsibility to load all other files it depons upon.Plugins are grouped according to the way they are used/required. Valid groups (subdirectories) are: