diff options
author | redmatrix <git@macgirvin.com> | 2016-05-14 17:18:51 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-14 17:18:51 -0700 |
commit | b497faee27a89ff1a2da07d02dd6f6676183cc98 (patch) | |
tree | e84343c18d327f5222c6617cb083431ec5d00935 /boot.php | |
parent | 269055e71c3959bd769133f23b033bcbefee27ce (diff) | |
download | volse-hubzilla-b497faee27a89ff1a2da07d02dd6f6676183cc98.tar.gz volse-hubzilla-b497faee27a89ff1a2da07d02dd6f6676183cc98.tar.bz2 volse-hubzilla-b497faee27a89ff1a2da07d02dd6f6676183cc98.zip |
Allow plugins to define autoloaded classes - a class such as Foobar\Class will load addon/foobar/Class.php and also Foobar\Category\Class.php will load addon/foobar/Category/Class.php
Diffstat (limited to 'boot.php')
-rwxr-xr-x | boot.php | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -632,6 +632,17 @@ class ZotlabsAutoloader { return TRUE; } } + $arr = explode('\\',$className); + if($arr && count($arr) > 1) { + $filename = 'addon/' . lcfirst($arr[0]) . '/' . ucfirst($arr[1]) . ((count($arr) === 2) ? '.php' : '/' . ucfirst($arr[2]) . ".php"); + if (file_exists($filename)) { + include($filename); + if (class_exists($className)) { + return TRUE; + } + } + } + return FALSE; } } |