Plugins

API Documentation

\GSPPanel\Plugins

This class controls the plugin system

Methods

bindEvent(string $event, string $plugin, string $method, integer $priority = 10) : void

Binds a plugin and method to an event

Parameters
NameTypeDescription
$eventstring

The event to bind to

$pluginstring

The plugins name

$methodstring

The plugins method to call when the event is triggered

$priorityinteger

The priority if multiple binds exist, default is 10

checkEvent(string $event) : boolean

Returns true if something is bound to the event

Parameters
NameTypeDescription
$eventstring

The event name

Returns
TypeDescription
boolean
getInstance() : \GSPPanel\Plugins

Returns the instance of the plugins class

Returns
TypeDescription
\GSPPanel\Plugins
getPluginDetails(string $plugin) : array

Returns the details from the meta information for the plugin

Parameters
NameTypeDescription
$pluginstring
Returns
TypeDescription
arrayArray of plugin details
getPluginVar(string $plugin, string $var) : string | integer | array | boolean

Returns a variable from a plugin instance

Parameters
NameTypeDescription
$pluginstring

Plugin name

$varstring

Variable name

Returns
TypeDescription
string | integer | array | boolean
installPlugin(string $plugin) : array

Installs the plugin

Parameters
NameTypeDescription
$pluginstring

The name of the plugin

Returns
TypeDescription
array
listBinds(string $event) : array

Lists all the events that are bound

Parameters
NameTypeDescription
$eventstring

The event type

Returns
TypeDescription
array
listEnabled(string $type = null) : void

Returns a list of enabled plugins of the specified type

Parameters
NameTypeDescription
$typestring

The type of plugin (Addon Manager, Update Manager, Query Code)

listPlugins() : array

Get a list of all the plugins available as well as their details

Returns
TypeDescription
arrayArray of plugins
loadPlugin(string $plugin) : boolean

Load the plugin and call the init method if it exists

Parameters
NameTypeDescription
$pluginstring

The name of the plugin

Returns
TypeDescription
boolean
loadPlugins() : void

Search the database and load any required plugins

registerPlugin(string $plugin, array $meta) : void

Register the plugin in the system, this means it has been loaded

Parameters
NameTypeDescription
$pluginstring

The name of the plugin

$metaarray

The array of data returned from getPluginDetails

triggerEvent(string $event, string | integer | array $params = array()) : boolean | string | integer

Triggers an event which then calls the plugin's EventCalled function if it exists or the function directly

Parameters
NameTypeDescription
$eventstring

The event that has been triggered

$paramsstring | integer | array

The parameters to be passed to the event handler

Returns
TypeDescription
boolean | string | integer
triggerPluginEvent(string $plugin, string $event, string | integer | array $params = null) : boolean | string | integer | array

Triggers an event for a specific plugin which then calls the plugin's EventCalled function if it exists or the function directly

Parameters
NameTypeDescription
$pluginstring

The plugin to call

$eventstring

The event that has been triggered

$paramsstring | integer | array

The parameters to be passed to the event handler

Returns
TypeDescription
boolean | string | integer | array
uninstallPlugin(string $plugin) : array

Uninstalls the plugin

Parameters
NameTypeDescription
$pluginstring

The name of the plugin

Returns
TypeDescription
array
Documentation was generated by phpDocumentor 2.9.0.