diff options
author | Andreas Gohr <andi@splitbrain.org> | 2010-08-29 12:27:41 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2010-08-29 12:27:41 +0200 |
commit | db6f7eaea3a9b1b536f2b65e54c911f2a4d49bd8 (patch) | |
tree | 2f77873ace86e520487adfdb35b9d0940f103e9a /inc/plugincontroller.class.php | |
parent | d0eb2708ceb86233e21f3c7da5f124ad78f127dc (diff) | |
download | rpg-db6f7eaea3a9b1b536f2b65e54c911f2a4d49bd8.tar.gz rpg-db6f7eaea3a9b1b536f2b65e54c911f2a4d49bd8.tar.bz2 |
don't load disabled plugins FS#1990
Diffstat (limited to 'inc/plugincontroller.class.php')
-rw-r--r-- | inc/plugincontroller.class.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php index 61f460414..ad394e11f 100644 --- a/inc/plugincontroller.class.php +++ b/inc/plugincontroller.class.php @@ -55,15 +55,23 @@ class Doku_Plugin_Controller { * * @author Andreas Gohr <andi@splitbrain.org> * - * @param $type string type of plugin to load - * @param $name string name of the plugin to load - * @param $new bool true to return a new instance of the plugin, false to use an already loaded instance + * @param $type string type of plugin to load + * @param $name string name of the plugin to load + * @param $new bool true to return a new instance of the plugin, false to use an already loaded instance + * @param $disabled bool true to load even disabled plugins * @return objectreference the plugin object or null on failure */ - function &load($type,$name,$new=false){ + function &load($type,$name,$new=false,$disabled=false){ //we keep all loaded plugins available in global scope for reuse global $DOKU_PLUGINS; + list($plugin,$component) = $this->_splitName($name); + + // check if disabled + if(!$disabled && $this->isdisabled($plugin)){ + return null; + } + //plugin already loaded? if(!empty($DOKU_PLUGINS[$type][$name])){ if ($new || !$DOKU_PLUGINS[$type][$name]->isSingleton()) { @@ -75,7 +83,6 @@ class Doku_Plugin_Controller { } //try to load the wanted plugin file - list($plugin,$component) = $this->_splitName($name); $dir = $this->get_directory($plugin); $file = $component ? "$type/$component.php" : "$type.php"; |