Plugins

API Documentation

\GSPPanel\Plugins

This class controls the plugin system

Methods

bindEvent(\GSPPanel\type $event, \GSPPanel\type $plugin, \GSPPanel\type $method, \GSPPanel\type $priority = 10) : void

Binds a plugin and method to an event

Parameters
NameTypeDescription
$event\GSPPanel\type

The event to bind to

$plugin\GSPPanel\type

The plugins name

$method\GSPPanel\type

The plugins method to call when the event is triggered

$priority\GSPPanel\type

The priority if multiple binds exist, default is 10

checkEvent(\GSPPanel\type $event) : boolean

Returns true if something is bound to the event

Parameters
NameTypeDescription
$event\GSPPanel\type

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

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
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.