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

vendor prefix plugin namespace

As suggested by @micgro42 the plugin namespace should use a vendor
prefix to avoid name clashes when DokuWiki is integrated with other
software.
parent 600fb65e
No related branches found
No related tags found
No related merge requests found
......@@ -111,15 +111,11 @@ function load_autoload($name){
return true;
}
// our own namespace
// namespace to directory conversion
$name = str_replace('\\', '/', $name);
if(substr($name, 0, 9) == 'dokuwiki/') {
require substr($name, 9) . '.php';
return true;
}
// plugin namespace
if(substr($name, 0, 7) == 'plugin/') {
if(substr($name, 0, 16) == 'dokuwiki/plugin/') {
$name = str_replace('/test/', '/_test/', $name); // no underscore in test namespace
$file = DOKU_PLUGIN . substr($name, 7) . '.php';
if(file_exists($file)) {
......@@ -128,6 +124,12 @@ function load_autoload($name){
}
}
// our own namespace
if(substr($name, 0, 9) == 'dokuwiki/') {
require substr($name, 9) . '.php';
return true;
}
// Plugin loading
if(preg_match('/^(auth|helper|syntax|action|admin|renderer|remote)_plugin_('.DOKU_PLUGIN_NAME_REGEX.')(?:_([^_]+))?$/',
$name, $m)) {
......
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