$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 |
SCRIPT_NAME | /index.php |
REQUEST_URI | /index/numbers-matching.html |
QUERY_STRING | s=/index/numbers-matching.html |
REQUEST_METHOD | GET |
SERVER_PROTOCOL | HTTP/2.0 |
GATEWAY_INTERFACE | CGI/1.1 |
REDIRECT_QUERY_STRING | s=/index/numbers-matching.html |
REDIRECT_URL | /index/numbers-matching.html |
REMOTE_PORT | 56942 |
SCRIPT_FILENAME | /www/wwwroot/vip/public/index.php |
SERVER_ADMIN | webmasterexample.com |
CONTEXT_DOCUMENT_ROOT | /www/wwwroot/vip/public |
CONTEXT_PREFIX | |
REQUEST_SCHEME | https |
DOCUMENT_ROOT | /www/wwwroot/vip/public |
REMOTE_ADDR | 34.229.223.223 |
SERVER_PORT | 443 |
SERVER_ADDR | 172.17.44.93 |
SERVER_NAME | sunflowervip.com |
SERVER_SOFTWARE | Apache |
SERVER_SIGNATURE | <address>Apache Server at sunflowervip.com Port 443</address> |
LD_LIBRARY_PATH | /www/server/apache/lib:/www/server/apache/lib |
PATH | /www/server/panel/pyenv/bin:/www/server/panel/pyenv/bin:/root/.nvm/versions/node/v14.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin |
HTTP_HOST | sunflowervip.com |
HTTP_USER_AGENT | claudebot |
HTTP_ACCEPT | */* |
proxy-nokeepalive | 1 |
H2_STREAM_TAG | 1036-3 |
H2_STREAM_ID | 3 |
H2_PUSHED_ON | |
H2_PUSHED | |
H2_PUSH | off |
H2PUSH | off |
HTTP2 | on |
SSL_TLS_SNI | sunflowervip.com |
HTTPS | on |
REDIRECT_STATUS | 200 |
REDIRECT_H2_STREAM_TAG | 1036-3 |
REDIRECT_H2_STREAM_ID | 3 |
REDIRECT_H2_PUSHED_ON | |
REDIRECT_H2_PUSHED | |
REDIRECT_H2_PUSH | off |
REDIRECT_H2PUSH | off |
REDIRECT_HTTP2 | on |
REDIRECT_SSL_TLS_SNI | sunflowervip.com |
REDIRECT_HTTPS | on |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1710839361.8324 |
REQUEST_TIME | 1710839361 |