20 lines
710 B
PHP
20 lines
710 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
// 仅供隔离 HTTP 测试使用:保留真实路由与控制器,禁止框架读取项目 .env。
|
|
$serverRoot = dirname(__DIR__) . '/server';
|
|
$runtime = getenv('IAM_RUNTIME_PATH');
|
|
if (!is_string($runtime) || !preg_match('~^(?:[A-Za-z]:[\\\\/]|/)~', $runtime) || str_contains($runtime, "\0")) {
|
|
http_response_code(503);
|
|
exit('Isolated runtime required');
|
|
}
|
|
require $serverRoot . '/vendor/autoload.php';
|
|
$app = new class($serverRoot) extends \think\App {
|
|
public function loadEnv(string $envName = ''): void {}
|
|
};
|
|
$app->setRuntimePath(rtrim($runtime, '/\\') . '/framework/');
|
|
$http = $app->http;
|
|
$response = $http->run();
|
|
$response->send();
|
|
$http->end($response);
|