Skip to content
Snippets Groups Projects
Commit 74efffc3 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

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.
parent 04556a0a
No related branches found
No related tags found
No related merge requests found
......@@ -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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment