$enabled
$enabled : boolean|null
Boolean indicating if this plugin is enabled (TRUE) or disabled (FALSE)
Abstract class to extend from when implementing a Pico plugin
Please refer to \PicoPluginInterface for more information about how to develop a plugin for Pico.
$pico : \Pico
Current instance of Pico
__construct(\Pico $pico)
Constructs a new instance of a Pico plugin
\Pico | $pico | current instance of Pico |
setEnabled(boolean $enabled, boolean $recursive = true, boolean $auto = false) : void
Enables or disables this plugin
boolean | $enabled | enable (TRUE) or disable (FALSE) this plugin |
boolean | $recursive | when TRUE, enable or disable recursively. In other words, if you enable a plugin, all required plugins are enabled, too. When disabling a plugin, all depending plugins are disabled likewise. Recursive operations are only performed as long as a plugin wasn't enabled/disabled manually. This parameter is optional and defaults to TRUE. |
boolean | $auto | enable or disable to fulfill a dependency. This parameter is optional and defaults to FALSE. |
isEnabled() : boolean|null
Returns a boolean indicating whether this plugin is enabled or not
You musn't rely on the return value when Pico's onConfigLoaded
event
wasn't triggered on all plugins yet. This method might even return NULL
then. The plugin's status might change later.
plugin is enabled (TRUE) or disabled (FALSE)
getPico() : \Pico
Returns the plugins instance of Pico
the plugins instance of Pico
getPluginConfig(string $configName = null, mixed $default = null) : mixed
Returns either the value of the specified plugin config variable or the config array
string | $configName | optional name of a config variable |
mixed | $default | optional default value to return when the named config variable doesn't exist |
if no name of a config variable has been supplied, the plugin's config array is returned; otherwise it returns either the value of the named config variable, or, if the named config variable doesn't exist, the provided default value or NULL
checkCompatibility() : void
Checks compatibility with Pico's API version
Pico automatically adds a dependency to \PicoDeprecated when the plugin's API is older than Pico's API. \PicoDeprecated furthermore throws a exception when it can't provide compatibility in such cases. However, we still have to decide whether this plugin is compatible to newer API versions, what requires some special (version specific) precaution and is therefore usually not the case.
thrown when the plugin's and Pico's API aren't compatible