<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2019 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\App;

// [ 应用入口文件 ]

// 引入安全 Session 配置
require __DIR__ . '/../app/SessionSecurity.php';

require __DIR__ . '/../vendor/autoload.php';

// 修正 PATH_INFO：如果包含 /index.php，则去除它（多应用模式兼容）
if (!empty($_SERVER['PATH_INFO']) && strpos($_SERVER['PATH_INFO'], '/index.php') === 0) {
    $_SERVER['PATH_INFO'] = substr($_SERVER['PATH_INFO'], 10); // 去掉 /index.php
}

// 执行HTTP应用并响应
$http = (new App())->http;
$response = $http->run();
$response->send();
$http->end($response);
