\GSPPanel\Plugins
Methods
bindEvent(string $event, string $plugin, string $method, integer $priority = 10) : void
Binds a plugin and method to an event
Name | Type | Description |
---|---|---|
$event | string | The event to bind to |
$plugin | string | The plugins name |
$method | string | The plugins method to call when the event is triggered |
$priority | integer | The priority if multiple binds exist, default is 10 |
checkEvent(string $event) : boolean
Returns true if something is bound to the event
Name | Type | Description |
---|---|---|
$event | string | The event name |
Type | Description |
---|---|
boolean |
getInstance() : \GSPPanel\Plugins
Returns the instance of the plugins class
Type | Description |
---|---|
\GSPPanel\Plugins |
getPluginDetails(string $plugin) : array
Returns the details from the meta information for the plugin
Name | Type | Description |
---|---|---|
$plugin | string |
Type | Description |
---|---|
array | Array of plugin details |
getPluginVar(string $plugin, string $var) : string | integer | array | boolean
Returns a variable from a plugin instance
Name | Type | Description |
---|---|---|
$plugin | string | Plugin name |
$var | string | Variable name |
Type | Description |
---|---|
string | integer | array | boolean |
installPlugin(string $plugin) : array
Installs the plugin
Name | Type | Description |
---|---|---|
$plugin | string | The name of the plugin |
Type | Description |
---|---|
array |
listBinds(string $event) : array
Lists all the events that are bound
Name | Type | Description |
---|---|---|
$event | string | The event type |
Type | Description |
---|---|
array |
listEnabled(string $type = null) : void
Returns a list of enabled plugins of the specified type
Name | Type | Description |
---|---|---|
$type | string | 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
Type | Description |
---|---|
array | Array of plugins |
loadPlugin(string $plugin) : boolean
Load the plugin and call the init method if it exists
Name | Type | Description |
---|---|---|
$plugin | string | The name of the plugin |
Type | Description |
---|---|
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
Name | Type | Description |
---|---|---|
$plugin | string | The name of the plugin |
$meta | array | 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
Name | Type | Description |
---|---|---|
$event | string | The event that has been triggered |
$params | string | integer | array | The parameters to be passed to the event handler |
Type | Description |
---|---|
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
Name | Type | Description |
---|---|---|
$plugin | string | The plugin to call |
$event | string | The event that has been triggered |
$params | string | integer | array | The parameters to be passed to the event handler |
Type | Description |
---|---|
boolean | string | integer | array |
uninstallPlugin(string $plugin) : array
Uninstalls the plugin
Name | Type | Description |
---|---|---|
$plugin | string | The name of the plugin |
Type | Description |
---|---|
array |