X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fframework.php;h=27d12351fa1165a04fa10434a5b67ea5e2992cc1;hb=d2104b89d93d40bf68884055196340465f3f6497;hp=fc0f35686c2c6fa196650fc7bc79a8709c81a6d7;hpb=53d54eb929fc2577529d45e68b77f3cdec52b2ed;p=quix0rs-gnu-social.git diff --git a/lib/framework.php b/lib/framework.php index fc0f35686c..27d12351fa 100644 --- a/lib/framework.php +++ b/lib/framework.php @@ -121,15 +121,17 @@ function GNUsocial_class_autoload($cls) } } -// XXX: how many of these could be auto-loaded on use? -// XXX: note that these files should not use config options -// at compile time since DB config options are not yet loaded. - -// Autoload queue +// Autoload function queue, starting with our own discovery method spl_autoload_register('GNUsocial_class_autoload'); -// Extlibs with namespaces (or directly in extlib/) -// such as: Validate and \Michelf\Markdown +/** + * Extlibs with namespaces (or directly in extlib/) + * This covers libraries such as: Validate and \Michelf\Markdown + * + * The namespaced based structure is called "PSR-0 autoloading standard": + * \\(\)* + * and is available here: http://www.php-fig.org/psr/psr-0/ +*/ spl_autoload_register(function($class){ $file = INSTALLDIR.'/extlib/'.preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php'; if (file_exists($file)) {