Package: Plugin\Broker
Plugin Broker for Omeka.
For example,$broker->callHook(‘add_action_contexts’, array(‘controller’ => $controller))would call the ‘add_action_contexts’ on all plugins, and it would provide thecontroller object as the first argument to all implementations of that hook.
Array of hooks that have been implemented for plugins.
Stores all defined filters.
Storage in array where $_filters[‘filterName’][‘priority’][‘plugin’] = $hook;
The directory name of the current plugin (used for calling hooks)
Add a hook implementation for a plugin.
Parameters: |
|
---|---|
Returns: | void |
Get the hook implementation for a plugin.
Parameters: |
|
---|---|
Returns: | callback|null |
Set the currently-focused plugin by directory name.
The plugin helper functions do not have any way of determining whatplugin to is currently in focus. These get/setCurrentPluginDirNamemethods allow the broker to know how to delegate to specific plugins ifnecessary.
Parameters: |
|
---|---|
Returns: | void |
Get the directory name of the currently-focused plugin.
Returns: | string |
---|
Call a hook by name.
Hooks can either be called globally or for a specific plugin only.
Parameters: |
|
---|---|
Returns: | void |
Add a filter implementation.
Parameters: |
|
---|---|
Returns: | void |
Retrieve the namespace to use for the filter to be added.
Returns: | string Name of the current plugin (if applicable). Otherwise, a magic constant that denotes globally applied filters. |
---|
Retrieve the key used for indexing the filter. The filter name should be either a string or an array of strings. If the filter name is an object, that might cause fiery death when using the serialized value for an array key.
Parameters: |
|
---|---|
Returns: | string Key for filter indexing. |
Return all the filters for a specific hook in the correct order of execution.
Parameters: |
|
---|---|
Returns: | array Indexed array of filter callbacks. |
Clear all implementations for a filter (or all filters).
Parameters: |
|
---|---|
Returns: | void |
Run an arbitrary value through a set of filters.
Parameters: |
|
---|---|
Returns: | mixed Result of applying filters to $value. |
Register the plugin broker so that plugin writers can use global functions like add_plugin_hook() to interact with the plugin API.
Returns: | void |
---|