summaryrefslogtreecommitdiff
path: root/inc/load.php
diff options
context:
space:
mode:
authorKate Arzamastseva <pshns@ukr.net>2011-06-24 11:32:51 +0300
committerKate Arzamastseva <pshns@ukr.net>2011-06-24 11:32:51 +0300
commita2dc299eb0593f35454deb21a2cb5d51a235e80a (patch)
tree5b14bf906bbd13495826ebbe86d3af1c8fd88f71 /inc/load.php
parent70c3cc9a17d47d8986cba0805d943c1a68af1740 (diff)
parentc949174a2e8c324e3e463a9d10e9e6dc07b0ba9e (diff)
downloadrpg-a2dc299eb0593f35454deb21a2cb5d51a235e80a.tar.gz
rpg-a2dc299eb0593f35454deb21a2cb5d51a235e80a.tar.bz2
Merge branch 'master' of git://github.com/splitbrain/dokuwiki into media-revisions
Diffstat (limited to 'inc/load.php')
-rw-r--r--inc/load.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/inc/load.php b/inc/load.php
index ef6f7f31c..d30397f6e 100644
--- a/inc/load.php
+++ b/inc/load.php
@@ -43,7 +43,7 @@ require_once(DOKU_INC.'inc/auth.php');
* require()s their associated php files when an object is instantiated.
*
* @author Andreas Gohr <andi@splitbrain.org>
- * @todo add generic loading of plugins and other generically named classes
+ * @todo add generic loading of renderers and auth backends
*/
function load_autoload($name){
static $classes = null;
@@ -87,5 +87,16 @@ function load_autoload($name){
require_once($classes[$name]);
return;
}
+
+ // Plugin loading
+ if(preg_match('/^(helper|syntax|action|admin|renderer)_plugin_([^_]+)(?:_([^_]+))?$/',
+ $name, $m)) {
+ //try to load the wanted plugin file
+ // include, but be silent. Maybe some other autoloader has an idea
+ // how to load this class.
+ $c = ((count($m) === 4) ? "/{$m[3]}" : '');
+ @include DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php";
+ return;
+ }
}