$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) {
zh/$v_url |
PHPSESSID | 6ee0f9b62d326a7f718429d5ea2b531d |
USER | www |
HOME | /home/www |
SCRIPT_NAME | /index.php |
REQUEST_URI | /zh/$v.url |
QUERY_STRING | zh/$v.url |
REQUEST_METHOD | GET |
SERVER_PROTOCOL | HTTP/1.1 |
GATEWAY_INTERFACE | CGI/1.1 |
REDIRECT_QUERY_STRING | zh/$v.url |
REDIRECT_URL | /zh/$v.url |
REMOTE_PORT | 57488 |
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 | 170.130.200.174 |
SERVER_PORT | 80 |
SERVER_ADDR | 172.19.137.82 |
SERVER_NAME | best-carrier.com |
SERVER_SOFTWARE | Apache |
SERVER_SIGNATURE | Apache Server at best-carrier.com Port 80 |
LD_LIBRARY_PATH | /www/server/apache/lib |
PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin |
HTTP_COOKIE | PHPSESSID=6ee0f9b62d326a7f718429d5ea2b531d |
HTTP_ACCEPT_ENCODING | gzip |
HTTP_ACCEPT | */* |
HTTP_HOST | best-carrier.com |
HTTP_USER_AGENT | Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) |
proxy-nokeepalive | 1 |
REDIRECT_STATUS | 200 |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1734326792.1381 |
REQUEST_TIME | 1734326792 |