public static function classloader($classname) {
        self::init();

        if (isset(self::$classmap[$classname])) {
            // Global $CFG is expected in included scripts.
            global $CFG;
            // Function include would be faster, but for BC it is better to include only once.
            include_once(self::$classmap[$classname]);
            return;
        }
        if (isset(self::$classmaprenames[$classname]) && isset(self::$classmap[self::$classmaprenames[$classname]])) {
            $newclassname = self::$classmaprenames[$classname];
            $debugging = "Class '%s' has been renamed for the autoloader and is now deprecated. Please use '%s' instead.";
            debugging(sprintf($debugging, $classname, $newclassname), DEBUG_DEVELOPER);
            if (PHP_VERSION_ID >= 70000 && preg_match('#\\\null(\\\|$)#', $classname)) {
                throw new \coding_exception("Cannot alias $classname to $newclassname");
            }
            class_alias($newclassname, $classname);
            return;
        }

        $file = self::psr_classloader($classname);
        // If the file is found, require it.
        if (!empty($file)) {
            require($file);
            return;
        }
    }
public static function classloader($classname) {
        self::init();

        if (isset(self::$classmap[$classname])) {
            // Global $CFG is expected in included scripts.
            global $CFG;
            // Function include would be faster, but for BC it is better to include only once.
            include_once(self::$classmap[$classname]);
            return;
        }
        if (isset(self::$classmaprenames[$classname]) && isset(self::$classmap[self::$classmaprenames[$classname]])) {
            $newclassname = self::$classmaprenames[$classname];
            $debugging = "Class '%s' has been renamed for the autoloader and is now deprecated. Please use '%s' instead.";
            debugging(sprintf($debugging, $classname, $newclassname), DEBUG_DEVELOPER);
            if (PHP_VERSION_ID >= 70000 && preg_match('#\\\null(\\\|$)#', $classname)) {
                throw new \coding_exception("Cannot alias $classname to $newclassname");
            }
            class_alias($newclassname, $classname);
            return;
        }

        $file = self::psr_classloader($classname);
        // If the file is found, require it.
        if (!empty($file)) {
            require($file);
            return;
        }
    }
public static function classloader ( $ classname ) { self :: init ( ) ; if ( isset ( self :: $ classmap [ $ classname ] ) ) { // Global $CFG is expected in included scripts. global $ CFG ; // Function include would be faster, but for BC it is better to include only once. include_once ( self :: $ classmap [ $ classname ] ) ; return ; } if ( isset ( self :: $ classmaprenames [ $ classname ] ) && isset ( self :: $ classmap [ self :: $ classmaprenames [ $ classname ] ] ) ) { $ newclassname = self :: $ classmaprenames [ $ classname ] ; $ debugging = "Class '%s' has been renamed for the autoloader and is now deprecated. Please use '%s' instead." ; debugging ( sprintf ( $ debugging , $ classname , $ newclassname ) , DEBUG_DEVELOPER ) ; if ( PHP_VERSION_ID >= 70000 && preg_match ( '#\\\null(\\\|$)#' , $ classname ) ) { throw new \ coding_exception ( "Cannot alias $classname to $newclassname" ) ; } class_alias ( $ newclassname , $ classname ) ; return ; } $ file = self :: psr_classloader ( $ classname ) ; // If the file is found, require it. if ( ! empty ( $ file ) ) { require ( $ file ) ; return ; } }
Class loader for Frankenstyle named classes in standard locations.
Frankenstyle namespaces are supported.

The expected location for core classes is:
1/ core_xx_yy_zz ---> lib/classes/xx_yy_zz.php
2/ \core\xx_yy_zz ---> lib/classes/xx_yy_zz.php
3/ \core\xx\yy_zz ---> lib/classes/xx/yy_zz.php

The expected location for plugin classes is:
1/ mod_name_xx_yy_zz ---> mod/name/classes/xx_yy_zz.php
2/ \mod_name\xx_yy_zz ---> mod/name/classes/xx_yy_zz.php
3/ \mod_name\xx\yy_zz ---> mod/name/classes/xx/yy_zz.php

@param string $classname
Class loader for Frankenstyle named classes in standard locations . Frankenstyle namespaces are supported .