mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-18 17:00:06 +08:00
41 lines
1.4 KiB
PHP
41 lines
1.4 KiB
PHP
<?php declare(strict_types=1);
|
||
|
||
/**
|
||
* Website: https://mudew.com/
|
||
* Author: Lkeme
|
||
* License: The MIT License
|
||
* Email: Useri@live.cn
|
||
* Updated: 2022 ~ 2023
|
||
*
|
||
* _____ _ _ _ _ _ _____ _ _____ _____ _____
|
||
* | _ \ | | | | | | | | | | | ____| | | | _ \ | ____| | _ \ & /l、
|
||
* | |_| | | | | | | | | |_| | | |__ | | | |_| | | |__ | |_| | (゚、 。 7
|
||
* | _ { | | | | | | | _ | | __| | | | ___/ | __| | _ / \、゙ ~ヽ *
|
||
* | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \ じしf_, )ノ
|
||
* |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\
|
||
*/
|
||
|
||
error_reporting(E_ALL | E_STRICT);
|
||
date_default_timezone_set('Asia/Shanghai');
|
||
|
||
$libDir = dirname(__DIR__);
|
||
$npMap = [
|
||
'Tests\\' => $libDir . '/tests/',
|
||
"Bhp\\" => $libDir . '/src/',
|
||
];
|
||
|
||
spl_autoload_register(static function ($class) use ($npMap) {
|
||
foreach ($npMap as $np => $dir) {
|
||
$file = $dir . str_replace('\\', '/', substr($class, strlen($np))) . '.php';
|
||
|
||
if (file_exists($file)) {
|
||
include $file;
|
||
}
|
||
}
|
||
});
|
||
|
||
if (is_file(dirname(__DIR__, 3) . '/autoload.php')) {
|
||
require dirname(__DIR__, 3) . '/autoload.php';
|
||
} elseif (is_file(dirname(__DIR__) . '/vendor/autoload.php')) {
|
||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||
} |