$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) {
PATH | /usr/local/bin:/bin:/usr/bin |
HTTP_ACCEPT | */* |
HTTP_HOST | www.dealandcoupon.com |
HTTP_USER_AGENT | claudebot |
HTTP_X_HTTPS | 1 |
DOCUMENT_ROOT | /home/deal58287086/public_html |
REMOTE_ADDR | 54.163.221.133 |
REMOTE_PORT | 37504 |
SERVER_ADDR | 10.128.246.150 |
SERVER_NAME | www.dealandcoupon.com |
SERVER_ADMIN | webmaster@dealandcoupon.com |
SERVER_PORT | 443 |
REQUEST_SCHEME | https |
REQUEST_URI | /115-35/ |
REDIRECT_URL | /115-35/ |
REDIRECT_REQUEST_METHOD | GET |
HTTPS | on |
REDIRECT_STATUS | 200 |
X_SPDY | HTTP2 |
SSL_PROTOCOL | TLSv1.3 |
SSL_CIPHER | TLS_AES_256_GCM_SHA384 |
SSL_CIPHER_USEKEYSIZE | 256 |
SSL_CIPHER_ALGKEYSIZE | 256 |
SCRIPT_FILENAME | /home/deal58287086/public_html/index.php |
QUERY_STRING | s=/115-35/ |
SCRIPT_URI | https://www.dealandcoupon.com/115-35/ |
SCRIPT_URL | /115-35/ |
SCRIPT_NAME | /index.php |
SERVER_PROTOCOL | HTTP/1.1 |
SERVER_SOFTWARE | LiteSpeed |
REQUEST_METHOD | GET |
X-LSCACHE | on |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1711659784.3387 |
REQUEST_TIME | 1711659784 |
argv | [ "s=\/115-35\/" ] |
argc | 1 |