From a64eec16d2d0bb6f36960279324ff4c67887bfbb Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 27 Jan 2009 19:25:21 +0100 Subject: reverted plugin disabling method back to old behaviour Ignore-this: b5fadadeee9de8e52c41c056cf62be6d With this patch plugins are now disabled by placing a disabled file in the plugin directory again. Even though renaming plugin directories is the method with the fewest disk accesses it makes a lot of trouble with code revision control systems and, more important, Linux package management systems. Future versions of DokuWiki may use a central config file instead. This patch also fixes the problem with the plugin manager not checking the return values of the pugin_(dis|en)able functions correctly. darcs-hash:20090127182521-7ad00-62018a546d49d57582d93298c8228fd71601a5e8.gz --- inc/plugincontroller.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'inc/plugincontroller.class.php') diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php index 98f57f3a3..372ab4f17 100644 --- a/inc/plugincontroller.class.php +++ b/inc/plugincontroller.class.php @@ -97,14 +97,14 @@ class Doku_Plugin_Controller { function enable($plugin) { if (array_search($plugin, $this->list_disabled) !== false) { - return @rename(DOKU_PLUGIN.$plugin.'.disabled',DOKU_PLUGIN.$plugin); + return @unlink(DOKU_PLUGIN.$plugin.'/disabled'); } return false; } function disable($plugin) { - if (array_search($plugin, $this->list_enabled) !== false) { - return @rename(DOKU_PLUGIN.$plugin,DOKU_PLUGIN.$plugin.'.disabled'); + if (array_search($plugin, $this->list_enabled) !== false) { + return @touch(DOKU_PLUGIN.$plugin.'/disabled'); } return false; } @@ -120,7 +120,11 @@ class Doku_Plugin_Controller { if (is_file(DOKU_PLUGIN.$plugin)) continue; if (substr($plugin,-9) == '.disabled') { - $this->list_disabled[] = substr($plugin,0,-9); + // the plugin was disabled by rc2009-01-26 + // disabling mechanism was changed back very soon again + // to keep everything simple we just skip the plugin completely + }elseif(@file_exists(DOKU_PLUGIN.$plugin.'/disabled')){ + $this->list_disabled[] = $plugin; } else { $this->list_enabled[] = $plugin; } -- cgit v1.2.3