diff options
-rw-r--r-- | core/Plugin/Manager.php | 26 | ||||
-rw-r--r-- | tests/PHPUnit/Core/ReleaseCheckListTest.php | 4 |
2 files changed, 21 insertions, 9 deletions
diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php index 6c6578fe6e..ff001629e5 100644 --- a/core/Plugin/Manager.php +++ b/core/Plugin/Manager.php @@ -68,30 +68,45 @@ class Manager extends Singleton 'ExampleUI', 'ExampleVisualization', 'ExamplePluginTemplate', + ); + + protected $coreThemesDisabledByDefault = array( 'ExampleTheme', 'LeftMenu', + 'Zeitgeist', ); public function getPluginsToLoadDuringTests() { $toLoad = array(); foreach($this->readPluginsDirectory() as $plugin) { + + // Load all default plugins $isPluginBundledWithCore = $this->isPluginBundledWithCore($plugin); + + // Load plugins from submodules $isPluginOfficiallySupported = $this->isPluginOfficialAndNotBundledWithCore($plugin); // Do not enable other Login plugins $isPluginOfficiallySupported = $isPluginOfficiallySupported && strpos($plugin, 'Login') === false; - if($isPluginBundledWithCore || $isPluginOfficiallySupported) { + $loadPlugin = $isPluginBundledWithCore || $isPluginOfficiallySupported; + + // Do not enable other Themes + $isThemeDisabled = in_array($plugin, $this->coreThemesDisabledByDefault); + $loadPlugin = $loadPlugin && !$isThemeDisabled; + + if($loadPlugin) { $toLoad[] = $plugin; } } return $toLoad; } + public function getCorePluginsDisabledByDefault() { - return $this->corePluginsDisabledByDefault; + return array_merge( $this->corePluginsDisabledByDefault, $this->coreThemesDisabledByDefault); } // If a plugin hooks onto at least an event starting with "Tracker.", we load the plugin during tracker @@ -384,10 +399,11 @@ class Manager extends Singleton { $plugins = $this->getLoadedPlugins(); - foreach ($plugins as $plugin) - if ($plugin->isTheme() && $plugin->getPluginName() == $themeName) + foreach ($plugins as $plugin) { + if ($plugin->isTheme() && $plugin->getPluginName() == $themeName) { return new Theme($plugin); - + } + } throw new \Exception('Theme not found : ' . $themeName); } diff --git a/tests/PHPUnit/Core/ReleaseCheckListTest.php b/tests/PHPUnit/Core/ReleaseCheckListTest.php index 284810f3c3..9f756a0a6c 100644 --- a/tests/PHPUnit/Core/ReleaseCheckListTest.php +++ b/tests/PHPUnit/Core/ReleaseCheckListTest.php @@ -190,10 +190,6 @@ class ReleaseCheckListTest extends PHPUnit_Framework_TestCase // if not added to git, then it is not part of the release checklist. continue; } - - if($pluginName === \Piwik\Plugin\Manager::DEFAULT_THEME) { - continue; - } $manager = \Piwik\Plugin\Manager::getInstance(); $disabled = in_array($pluginName, $manager->getCorePluginsDisabledByDefault()); |