+/**
+ * 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":
+ * \<Vendor Name>\(<Namespace>\)*<Class Name>
+ * and is available here: http://www.php-fig.org/psr/psr-0/
+*/
+spl_autoload_register(function($class){
+ $class_base = preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\'));
+ $file = INSTALLDIR."/extlib/{$class_base}.php";
+ if (file_exists($file)) {
+ require_once $file;
+ return;
+ }