添加网站文件

This commit is contained in:
2025-12-22 13:59:40 +08:00
commit 117aaf83d1
19468 changed files with 2111999 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App;
class Autoloader{
public static function loadByNamespace($name)
{
$class_path = str_replace('\\', DIRECTORY_SEPARATOR, $name);
if (strpos($name, 'App\\') === 0) {
$class_file = __DIR__ . substr($class_path, strlen('App')) . '.php';
}elseif(empty($class_file) || !is_file($class_file)){
$class_file = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $class_path . ".php";
}
if (is_file($class_file)) {
require_once ($class_file);
if (class_exists($name, false)) {
return true;
}
}
return false;
}
}
spl_autoload_register('\App\Autoloader::loadByNamespace');