$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) {
$v_url |
USER | www |
HOME | /home/www |
SCRIPT_NAME | /index.php |
REQUEST_URI | /$v.url |
QUERY_STRING | $v.url |
REQUEST_METHOD | GET |
SERVER_PROTOCOL | HTTP/1.1 |
GATEWAY_INTERFACE | CGI/1.1 |
REDIRECT_QUERY_STRING | $v.url |
REDIRECT_URL | /$v.url |
REMOTE_PORT | 36770 |
SCRIPT_FILENAME | /www/wwwroot/bestcarrier/public/index.php |
SERVER_ADMIN | webmaster@example.com |
CONTEXT_DOCUMENT_ROOT | /www/wwwroot/bestcarrier/public |
CONTEXT_PREFIX | |
REQUEST_SCHEME | http |
DOCUMENT_ROOT | /www/wwwroot/bestcarrier/public |
REMOTE_ADDR | 192.161.56.224 |
SERVER_PORT | 80 |
SERVER_ADDR | 172.19.137.82 |
SERVER_NAME | www.15006719999.com |
SERVER_SOFTWARE | Apache |
SERVER_SIGNATURE | <address>Apache Server at www.15006719999.com Port 80</address> |
LD_LIBRARY_PATH | /www/server/apache/lib |
PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin |
HTTP_X_MICROSOFTAJAX | Delta=true |
HTTP_USER_AGENT | Mozilla/5.0 (Windows; U; Windows NT 5.2) Gecko/2008070208 Firefox/3.0.1 |
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.15006719999.com |
proxy-nokeepalive | 1 |
REDIRECT_STATUS | 200 |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1727923638.3919 |
REQUEST_TIME | 1727923638 |