* * @version 1.0 * @date updated Jan 26, 2023 */ namespace wlurep; class Loader { private static $defaultNamespace = 'wlurep'; private function __construct() { } public static function registerAutoLoad() { spl_autoload_register(array('\wlurep\Loader', 'autoload')); } public static function autoload($class) { self::loadClass($class); } public static function loadClass($class) { $file = realpath(substr_replace(str_replace('\\', DIRECTORY_SEPARATOR, $class), WL_UREP_PATH, 0, strlen(self::$defaultNamespace)) . '.php'); if ($file && is_readable($file)) { include $file; } } }