Manager
Click here if you want to read this article for the latest version.
Piwik\Plugin\
Manager
The singleton that manages plugin loading/unloading and installation/uninstallation.
Methods
The class defines the following methods:
isPluginActivated()— Returnstrueif a plugin has been activated.isPluginLoaded()— Returnstrueif 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.
Signature
- It accepts the following parameter(s):
$name(string) — Name of plugin, eg,'Actions'.
- It returns a
boolvalue.
isPluginLoaded()
Returns true if plugin is loaded (in memory).
Signature
- It accepts the following parameter(s):
$name(string) — Name of plugin, eg,'Acions'.
- It returns a
boolvalue.
getPluginsDirectories()
Returns the path to all plugins directories. Each plugins directory may contain several plugins.
All paths have a trailing slash '/'.
Signature
- It returns a
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.
Signature
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).
Signature
- It returns a
Pluginvalue.
loadAllPluginsAndGetTheirInfo()
Returns info regarding all plugins. Loads plugins that can be loaded.
Signature
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.
Signature
- It returns a
arrayvalue.
getMissingPlugins()
Returns names of plugins that should be loaded, but cannot be since their files cannot be found.
Signature
- It returns a
arrayvalue.