Skip to content
Extraits de code Groupes Projets
Valider 447ff12b rédigé par Matthieu Napoli's avatar Matthieu Napoli
Parcourir les fichiers

Merge pull request #8016 from piwik/fix/deactivating-plugins

Deactivating a plugin: clear the caches before unloading the plugin
parents 8e4f78ea 43e8bae0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -337,6 +337,8 @@ class Manager
*/
public function deactivatePlugin($pluginName)
{
$this->clearCache($pluginName);
// execute deactivate() to let the plugin do cleanups
$this->executePluginDeactivate($pluginName);
......@@ -344,8 +346,6 @@ class Manager
$this->removePluginFromConfig($pluginName);
$this->clearCache($pluginName);
/**
* Event triggered after a plugin has been deactivated.
*
......
......@@ -75,6 +75,15 @@ class ManagerTest extends IntegrationTestCase
$this->assertEquals(array(), $this->manager->getLoadedPlugins());
}
public function test_deactivatePlugin()
{
$this->assertFalse($this->manager->isPluginActivated('ExampleTheme'));
$this->manager->activatePlugin('ExampleTheme');
$this->assertTrue($this->manager->isPluginActivated('ExampleTheme'));
$this->manager->deactivatePlugin('ExampleTheme');
$this->assertFalse($this->manager->isPluginActivated('ExampleTheme'));
}
private function getCacheForTrackerPlugins()
{
return PiwikCache::getEagerCache();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter