diff options
author | Andreas Gohr <andi@splitbrain.org> | 2009-01-27 19:25:21 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2009-01-27 19:25:21 +0100 |
commit | a64eec16d2d0bb6f36960279324ff4c67887bfbb (patch) | |
tree | aedd4f489b874814bc6284bed4883d9c4accab66 /inc | |
parent | 8e790062800da9ede63ca6d3906c6c178beba5aa (diff) | |
download | rpg-a64eec16d2d0bb6f36960279324ff4c67887bfbb.tar.gz rpg-a64eec16d2d0bb6f36960279324ff4c67887bfbb.tar.bz2 |
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
Diffstat (limited to 'inc')
-rw-r--r-- | inc/plugincontroller.class.php | 12 |
1 files changed, 8 insertions, 4 deletions
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; } |