ZMObject
└─ZMPlugins
public class ZMPlugins
extends ZMObject
| Field Summary | |
|---|---|
| protected mixed | |
| protected mixed | |
| protected mixed | |
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | Create new instance. |
| protected integer | comparePlugins(ZMPlugin a, ZMPlugin b) Compare plugins. |
| array | getAllPlugins(int context, boolean enabled) Get all plugins. |
| array | Get a list of available plugin groups. |
| ZMPlugin | getPluginForId(string id, string group) Get the plugin for the given id. |
| protected array | getPluginIdsForGroup(string group) Generate a full list of plugin ids for the given group. |
| array | getPluginsForGroup(string group, int context, boolean enabled) Get all plugins for the given group. |
| ZMPlugin | initPluginForId(string id, boolean enabled) Convenience method to init a single plugin. |
| array | initPluginsForGroups(mixed groups, int context, boolean enabled) Init all plugins for the given group(s). |
| array | initPluginsForId(mixed ids, boolean enabled) Init all plugins of the given type and scope. |
| static void | instance() Get instance. |
| protected array | Load the plugin status data. |
| protected boolean | needsInit(string id) Check if a plugin needs be initialized. |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
protected mixed $pluginBaseDir_
protected mixed $pluginStatus_
protected mixed $plugins_
public void __construct()
Create new instance.
protected integer comparePlugins(ZMPlugin a, ZMPlugin b)
Compare plugins.
public array getAllPlugins(int context, boolean enabled)
Get all plugins.
true, return only enabled plugins: default is true.ZMPlugin instances for each group.public array getGroups()
Get a list of available plugin groups.
public ZMPlugin getPluginForId(string id, string group)
Get the plugin for the given id.
null to auto detect.null.protected array getPluginIdsForGroup(string group)
Generate a full list of plugin ids for the given group.
public array getPluginsForGroup(string group, int context, boolean enabled)
Get all plugins for the given group.
true, return only enabled plugins: default is true.ZMPlugin instances.public ZMPlugin initPluginForId(string id, boolean enabled)
Convenience method to init a single plugin.
true, return only enabled plugins: default is true.null.public array initPluginsForGroups(mixed groups, int context, boolean enabled)
Init all plugins for the given group(s).
true, return only enabled plugins: default is true.public array initPluginsForId(mixed ids, boolean enabled)
Init all plugins of the given type and scope.
NOTE: This method does not check for enabled or similar. It is the responsibility of the calling code to make sure that all ids are actually wanted!
true, return only enabled plugins: default is true.public static void instance()
Get instance.
protected array loadStatus()
Load the plugin status data.
The default implementation is to look at settings in the form zenmagick.core.plugins.[id].enabled.
protected boolean needsInit(string id)
Check if a plugin needs be initialized.
true if the plugin needs to be initialized.
Basic plugin service.
Plugins are grouped via the filesystem. The plugin base directory is expected to contain a subfolder for each group with the folder name being used as group name.
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 set use the appropricate loader policy