summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-05-08 16:27:17 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-05-08 16:27:17 +0200
commite7a32b176701c088bab045437819448bb9adad41 (patch)
treee02d5b9e25e1db29be8abacd578581a0bee26f09
parent12a4e4d1ed827c59290838d5a11d75ad32aa28f1 (diff)
downloadrpg-e7a32b176701c088bab045437819448bb9adad41.tar.gz
rpg-e7a32b176701c088bab045437819448bb9adad41.tar.bz2
added autoloading for namespaced classes
-rw-r--r--_test/tests/inc/form/form.test.php0
-rw-r--r--inc/load.php6
2 files changed, 6 insertions, 0 deletions
diff --git a/_test/tests/inc/form/form.test.php b/_test/tests/inc/form/form.test.php
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/_test/tests/inc/form/form.test.php
diff --git a/inc/load.php b/inc/load.php
index 18786dc79..19a8caa85 100644
--- a/inc/load.php
+++ b/inc/load.php
@@ -113,6 +113,12 @@ function load_autoload($name){
return;
}
+ // our own namespace
+ $name = str_replace('\\', '/', $name);
+ if(substr($name, 0, 9) == 'dokuwiki/') {
+ require_once(substr($name, 9) . '.php');
+ }
+
// Plugin loading
if(preg_match('/^(auth|helper|syntax|action|admin|renderer|remote)_plugin_('.DOKU_PLUGIN_NAME_REGEX.')(?:_([^_]+))?$/',
$name, $m)) {