From e7a32b176701c088bab045437819448bb9adad41 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 8 May 2015 16:27:17 +0200 Subject: added autoloading for namespaced classes --- _test/tests/inc/form/form.test.php | 0 inc/load.php | 6 ++++++ 2 files changed, 6 insertions(+) create mode 100644 _test/tests/inc/form/form.test.php 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 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)) { -- cgit v1.2.3