diff options
author | benakamoorthi <benaka.moorthi@gmail.com> | 2012-10-24 10:19:29 +0400 |
---|---|---|
committer | benakamoorthi <benaka.moorthi@gmail.com> | 2012-10-24 10:19:29 +0400 |
commit | 293d8d640b78f26cf1620b691c2c056b0a9490d0 (patch) | |
tree | 921c25c8d7fc925f7c64243e0ce185805d8a0737 /core/PluginsManager.php | |
parent | c62321fb3b004110ebdc2b0ea9e45b14fc7fd389 (diff) |
Refs #3404, refactor some code into PluginsManager method and fix typo in PluginsManager.
git-svn-id: http://dev.piwik.org/svn/trunk@7297 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/PluginsManager.php')
-rw-r--r-- | core/PluginsManager.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/core/PluginsManager.php b/core/PluginsManager.php index 4dfe131dcf..927d413fca 100644 --- a/core/PluginsManager.php +++ b/core/PluginsManager.php @@ -167,8 +167,8 @@ class Piwik_PluginsManager $result[] = $name; } } - return $result; } + return $result; } /** @@ -619,6 +619,29 @@ class Piwik_PluginsManager $pluginNames = Piwik_Config::getInstance()->PluginsInstalled['PluginsInstalled']; return $pluginNames; } + + /** + * Returns names of plugins that should be loaded, but cannot be since their + * files cannot be found. + * + * @return array + */ + public function getMissingPlugins() + { + $missingPlugins = array(); + if (isset(Piwik_Config::getInstance()->Plugins['Plugins'])) + { + foreach (Piwik_Config::getInstance()->Plugins['Plugins'] as $pluginName) + { + // if a plugin is listed in the config, but is not loaded, it does not exist in the folder + if (!Piwik_PluginsManager::getInstance()->isPluginLoaded($pluginName)) + { + $missingPlugins[] = $pluginName; + } + } + } + return $missingPlugins; + } /** * Install a plugin, if necessary |