$pico
$pico : \Pico
Current instance of Pico
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)
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 plugin's instance of Pico
the plugin's 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
getDependencies() : array<mixed,string>
Returns a list of names of plugins required by this plugin
required plugins
None found |
getDependants() : array<mixed,object>
Returns a list of plugins which depend on this plugin
dependant plugins
None found |
None found |
checkDependencies(boolean $recursive)
Enables all plugins which this plugin depends on
boolean | $recursive | enable required plugins automatically |
thrown when a dependency fails
None found |
checkDependants(boolean $recursive)
Disables all plugins which depend on this plugin
boolean | $recursive | disabled dependant plugins automatically |
thrown when a dependency fails
None found |
checkCompatibility()
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 if 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
None found |