Piwik\Plugin\
The singleton that manages plugin loading/unloading and installation/uninstallation.
The class defines the following methods:
isPluginActivated()
— Returns true
if a plugin has been activated.isPluginLoaded()
— Returns true
if plugin is loaded (in memory).getPluginsDirectories()
— Returns the path to all plugins directories.getPluginDirectory()
— Gets the path to a specific plugin.getThemeEnabled()
— Returns the currently enabled theme.loadAllPluginsAndGetTheirInfo()
— Returns info regarding all plugins.getInstalledPluginsName()
— Return names of all installed plugins.getMissingPlugins()
— Returns names of plugins that should be loaded, but cannot be since their files cannot be found.isPluginActivated()
Returns true
if a plugin has been activated.
$name
(string
) —
Name of plugin, eg, 'Actions'
.bool
value.isPluginLoaded()
Returns true
if plugin is loaded (in memory).
$name
(string
) —
Name of plugin, eg, 'Acions'
.bool
value.getPluginsDirectories()
Returns the path to all plugins directories. Each plugins directory may contain several plugins.
All paths have a trailing slash '/'.
string[]
value.getPluginDirectory()
Gets the path to a specific plugin. If the plugin does not exist in any plugins folder, the default plugins folder will be assumed.
It accepts the following parameter(s):
$pluginName
Returns: mixed
|string
—
getThemeEnabled()
Returns the currently enabled theme.
If no theme is enabled, the Morpheus plugin is returned (this is the base and default theme).
Piwik\Plugin\Piwik\Plugin
|null
—loadAllPluginsAndGetTheirInfo()
Returns info regarding all plugins. Loads plugins that can be loaded.
Returns: array
—
An array that maps plugin names with arrays of plugin information. Plugin
information consists of the following entries:
- **activated**: Whether the plugin is activated.
- **alwaysActivated**: Whether the plugin should always be activated,
or not.
- **uninstallable**: Whether the plugin is uninstallable or not.
- **invalid**: If the plugin is invalid, this property will be set to true.
If the plugin is not invalid, this property will not exist.
- **info**: If the plugin was loaded, will hold the plugin information.
See [Plugin::getInformation()](/api-reference/Piwik/Plugin#getinformation).
getInstalledPluginsName()
Return names of all installed plugins.
array
value.getMissingPlugins()
Returns names of plugins that should be loaded, but cannot be since their files cannot be found.
array
value.