Initial commit

This commit is contained in:
Fill committed 2023-04-10 12:42:23 +03:00
1 parent bd472155ce
commit a1ea747e34
8 files changed
+5167 -1

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
<?php
/**
* Loader controller.
*
* @author Ivan Filipov <ivan@web-lab.solutions>
*
* @version 1.0
* @date updated Jan 26, 2023
*/
namespace wlsrm;
class Loader {
private static $defaultNamespace = 'wlsrm';
private function __construct() {
}
public static function registerAutoLoad() {
spl_autoload_register(array('\wlsrm\Loader', 'autoload'));
}
public static function autoload($class) {
self::loadClass($class);
}
public static function loadClass($class) {
$file = realpath(substr_replace(str_replace('\\', DIRECTORY_SEPARATOR, $class), WLSRM_PATH, 0, strlen(self::$defaultNamespace)) . '.php');
if ($file && is_readable($file)) {
include $file;
}
}
}