diff options
author | Andreas Gohr <andi@splitbrain.org> | 2011-03-19 14:16:50 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2011-03-19 14:16:50 +0100 |
commit | 74efffc3dc025c612dcdfa70f31ad24dccf36682 (patch) | |
tree | b41d46f1ca97b98c0967ae50c5d8bc5b78107809 /inc | |
parent | 04556a0aabe1497bd711ca45405b8cfa2888d427 (diff) | |
download | rpg-74efffc3dc025c612dcdfa70f31ad24dccf36682.tar.gz rpg-74efffc3dc025c612dcdfa70f31ad24dccf36682.tar.bz2 |
warn about wrongly installed plugin
When a plugin is installed in the wrong directory, the class loading
will fail. This patch tries to find the correct directory from the
plugin.info.txt (using the base key) and give a hint to the user on how
to fix this.
Diffstat (limited to 'inc')
-rw-r--r-- | inc/plugincontroller.class.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php index 6e361e172..cec5c73a9 100644 --- a/inc/plugincontroller.class.php +++ b/inc/plugincontroller.class.php @@ -96,7 +96,15 @@ class Doku_Plugin_Controller { //construct class and instantiate $class = $type.'_plugin_'.$name; - if (!class_exists($class)) return null; + if (!class_exists($class)){ + # the plugin might be in the wrong directory + $inf = confToHash(DOKU_PLUGIN."$dir/plugin.info.txt"); + if($inf['base'] && $inf['base'] != $plugin){ + msg("Plugin installed incorrectly. Rename plugin directory '". + hsc($plugin)."' to '".hsc($inf['base'])."'.",-1); + } + return null; + } $DOKU_PLUGINS[$type][$name] = new $class; return $DOKU_PLUGINS[$type][$name]; |