$path = $this->rule->parseUrlPath($url);
if (empty($path)) {
return [null, null];
}
// 解析控制器
$controller = !empty($path) ? array_shift($path) : null;
if ($controller && !preg_match('/^[A-Za-z0-9][\w|\.]*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}
// 解析操作
$action = !empty($path) ? array_shift($path) : null;
$var = [];
// 解析额外参数
if ($path) {
preg_replace_callback('/(\w+)\|([^\|]+)/', function ($match) use (&$var) {
USER | www |
HOME | /home/www |
HTTP_HOST | gw005.com |
HTTP_USER_AGENT | claudebot |
HTTP_ACCEPT | */* |
PATH_INFO | /sh_8543_8685-0-5/index.php |
REDIRECT_STATUS | 200 |
SERVER_NAME | hnadny.com |
SERVER_PORT | 80 |
SERVER_ADDR | 45.158.223.104 |
REMOTE_PORT | 56550 |
REMOTE_ADDR | 44.200.193.174 |
SERVER_SOFTWARE | nginx/1.22.1 |
GATEWAY_INTERFACE | CGI/1.1 |
REQUEST_SCHEME | http |
SERVER_PROTOCOL | HTTP/1.1 |
DOCUMENT_ROOT | /www/wwwroot/hnadny.com/public |
DOCUMENT_URI | /index.php/sh_8543_8685-0-5/ |
REQUEST_URI | /sh_8543_8685-0-5/ |
SCRIPT_NAME | /index.php |
CONTENT_LENGTH | |
CONTENT_TYPE | |
REQUEST_METHOD | GET |
QUERY_STRING | |
SCRIPT_FILENAME | /www/wwwroot/hnadny.com/public/index.php |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php/sh_8543_8685-0-5/index.php |
REQUEST_TIME_FLOAT | 1711727790.1758 |
REQUEST_TIME | 1711727790 |