$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_X_MICROSOFTAJAX | Delta=true |
HTTP_USER_AGENT | Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) |
HTTP_CONTENT_TYPE | application/x-www-form-urlencoded; charset=utf-8 |
HTTP_CACHE_CONTROL | no-cache |
HTTP_ACCEPT_LANGUAGE | en-US,en;q=0.5 |
HTTP_ACCEPT_ENCODING | gzip, deflate |
HTTP_ACCEPT | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
HTTP_X_APPLE_STORE_FRONT | 143444,12 |
HTTP_X_APPLE_TZ | 0 |
HTTP_REFERER | https://www.baidu.com/search/spider.htm |
HTTP_HOST | www.xayuze.com |
PATH_INFO | |
REDIRECT_STATUS | 200 |
SERVER_NAME | xayuze.com |
SERVER_PORT | 80 |
SERVER_ADDR | 172.23.47.113 |
REMOTE_PORT | 52812 |
REMOTE_ADDR | 45.41.83.2 |
SERVER_SOFTWARE | nginx/1.20.2 |
GATEWAY_INTERFACE | CGI/1.1 |
REQUEST_SCHEME | http |
SERVER_PROTOCOL | HTTP/1.1 |
DOCUMENT_ROOT | /www/wwwroot/xayuze.com/public |
DOCUMENT_URI | /index.php |
REQUEST_URI | /mailto:market@xayuze.com |
SCRIPT_NAME | /index.php |
CONTENT_LENGTH | |
CONTENT_TYPE | application/x-www-form-urlencoded; charset=utf-8 |
REQUEST_METHOD | GET |
QUERY_STRING | s=/mailto:market@xayuze.com |
SCRIPT_FILENAME | /www/wwwroot/xayuze.com/public/index.php |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1729511412.7213 |
REQUEST_TIME | 1729511412 |