\GSPPanel\Plugins
Methods
bindEvent(string $event, string $plugin, string $method, integer $priority = 10) : voidBinds 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) : booleanReturns true if something is bound to the event
| Name | Type | Description |
|---|---|---|
| $event | string | The event name |
| Type | Description |
|---|---|
| boolean |
getInstance() : \GSPPanel\PluginsReturns the instance of the plugins class
| Type | Description |
|---|---|
| \GSPPanel\Plugins |
getPluginDetails(string $plugin) : arrayReturns 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 | booleanReturns 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) : arrayInstalls the plugin
| Name | Type | Description |
|---|---|---|
| $plugin | string | The name of the plugin |
| Type | Description |
|---|---|
| array |
listBinds(string $event) : arrayLists all the events that are bound
| Name | Type | Description |
|---|---|---|
| $event | string | The event type |
| Type | Description |
|---|---|
| array |
listEnabled(string $type = null) : voidReturns 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() : arrayGet a list of all the plugins available as well as their details
| Type | Description |
|---|---|
| array | Array of plugins |
loadPlugin(string $plugin) : booleanLoad the plugin and call the init method if it exists
| Name | Type | Description |
|---|---|---|
| $plugin | string | The name of the plugin |
| Type | Description |
|---|---|
| boolean |
loadPlugins() : voidSearch the database and load any required plugins
registerPlugin(string $plugin, array $meta) : voidRegister 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 | integerTriggers 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 | arrayTriggers 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) : arrayUninstalls the plugin
| Name | Type | Description |
|---|---|---|
| $plugin | string | The name of the plugin |
| Type | Description |
|---|---|
| array |