2db47680
hexiaodong
chore: 初始提交 php 遗...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// $Id$
// 获取请求的URI
$uri = isset($_SERVER['REQUEST_URI']) ? parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) : '';
// 如果是访问 RjMGJaNASs.php 或包含 RjMGJaNASs.php 的路径,使用后台入口文件
if (strpos($uri, '/RjMGJaNASs.php') !== false || strpos($uri, 'RjMGJaNASs.php') !== false) {
$_SERVER['SCRIPT_FILENAME'] = __DIR__ . '/RjMGJaNASs.php';
$_SERVER['SCRIPT_NAME'] = '/RjMGJaNASs.php';
// 移除 RjMGJaNASs.php 前缀,保留后续路径
if (preg_match('#/RjMGJaNASs\.php(.*)$#', $uri, $matches)) {
$_SERVER['PATH_INFO'] = $matches[1];
$_SERVER['REQUEST_URI'] = '/RjMGJaNASs.php' . $matches[1];
}
require __DIR__ . '/RjMGJaNASs.php';
return true;
}
// 如果文件存在,直接返回
if (isset($_SERVER['SCRIPT_NAME']) && is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
return false;
} else {
// 否则使用前台入口文件
$_SERVER["SCRIPT_FILENAME"] = __DIR__ . '/index.php';
require __DIR__ . "/index.php";
}
|