first commit

This commit is contained in:
jhx
2023-03-21 15:26:43 +08:00
commit d0dfc12286
183 changed files with 10563 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
<?php
require_once "vendor/autoload.php";
require_once "utils/helper/helper.php";
$uri = strtok($_SERVER['REQUEST_URI'], "?");
$path = explode('/', $uri)[1];
empty($path) && $path = 'index';
switch ($path) {
case "api" :
$path = "api";
break;
case "doapi" :
$path = "api";
break;
case "ip" :
$_GET['act'] = $path;
$path = "index";
$_GET['ip'] = explode('/', $uri)[2];
break;
default:
$_GET['act'] = $path;
$path = "index";
break;
}
$handlerPath = HANDLER_PATH . '/' . $path . ".php";
if (!file_exists($handlerPath)) {
\utils\View::getInstance()->fetch("404");
exit;
}
try {
require_once $handlerPath;
} catch (Exception $e) {
\utils\View::getInstance()->fetch("404");
exit;
var_dump($e->getMessage());
}