Constants

TABLE_PLUGINS

TABLE_PLUGINS

CB_PLUGIN_LOADED

CB_PLUGIN_LOADED

CB_PLUGIN_UNLOADED

CB_PLUGIN_UNLOADED

Properties

$pluginClasses

$pluginClasses : array<mixed,string>

Type

array<mixed,string>

Methods

__construct()

__construct(\ManiaControl\ManiaControl  $maniaControl) 

Construct a new plugin manager instance

Parameters

\ManiaControl\ManiaControl $maniaControl

getPluginId()

getPluginId(string  $pluginClass) : integer

Get the Plugin Id if the given Class is a Plugin

Parameters

string $pluginClass

Returns

integer

isPluginClass()

isPluginClass(string  $pluginClass) : boolean

Check if the given class implements the plugin interface

Parameters

string $pluginClass

Returns

boolean

deactivatePlugin()

deactivatePlugin(string  $pluginClass) : boolean

Deactivate the Plugin with the given Class

Parameters

string $pluginClass

Returns

boolean

getPluginClass()

getPluginClass(mixed  $pluginClass) : string

Get the Class of the Plugin

Parameters

mixed $pluginClass

Returns

string

isPluginActive()

isPluginActive(string  $pluginClass) : boolean

Check if the Plugin is currently running

Parameters

string $pluginClass

Returns

boolean

loadPlugins()

loadPlugins() : array<mixed,string>

Load complete Plugins Directory and start all configured Plugins

Returns

array<mixed,string>

loadPluginFiles()

loadPluginFiles(string  $directory = '') 

Load all Plugin Files from the Directory

Parameters

string $directory

addPluginClass()

addPluginClass(string  $pluginClass) : boolean

Add the class to array of loaded plugin classes

Parameters

string $pluginClass

Returns

boolean

getSavedPluginStatus()

getSavedPluginStatus(string  $className) : boolean

Get plugin status from database

Parameters

string $className

Returns

boolean

activatePlugin()

activatePlugin(string  $pluginClass, string  $adminLogin = null) : boolean

Activate and start the plugin with the given name

Parameters

string $pluginClass
string $adminLogin

Returns

boolean

isPluginIdInstalled()

isPluginIdInstalled(integer  $pluginId) : boolean

Check if the Plugin with the given ID is already installed and loaded

Parameters

integer $pluginId

Returns

boolean

getPlugin()

getPlugin(string  $pluginClass) : \ManiaControl\Plugins\Plugin

Returns a Plugin if it is activated

Parameters

string $pluginClass

Returns

\ManiaControl\Plugins\Plugin

getPluginClasses()

getPluginClasses() : array<mixed,string>

Get all declared plugin class names

Returns

array<mixed,string>

getActivePluginsIds()

getActivePluginsIds() : array<mixed,string>

Get the Ids of all active Plugins

Returns

array<mixed,string>

getActivePlugins()

getActivePlugins() : array<mixed,\ManiaControl\Plugins\Plugin>

Get all active Plugins

Returns

array<mixed,\ManiaControl\Plugins\Plugin>

fetchPluginList()

fetchPluginList(callable  $function) 

Fetch the Plugins List from the ManiaControl Website

Parameters

callable $function

initTables()

initTables() : boolean

Initialize necessary database tables

Returns

boolean

savePluginStatus()

savePluginStatus(string  $className, boolean  $active) : boolean

Save Plugin Status in Database

Parameters

string $className
boolean $active

Returns

boolean

validatePluginClass()

validatePluginClass(string  $pluginClass) : boolean

Validate that the given class is a correctly implemented plugin class

Parameters

string $pluginClass

Returns

boolean