mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进Request类的create方法
This commit is contained in:
@@ -227,6 +227,7 @@ class Request
|
|||||||
$info['path'] = '/';
|
$info['path'] = '/';
|
||||||
}
|
}
|
||||||
$options = [];
|
$options = [];
|
||||||
|
$options[strtolower($method)] = $params;
|
||||||
$queryString = '';
|
$queryString = '';
|
||||||
if (isset($info['query'])) {
|
if (isset($info['query'])) {
|
||||||
parse_str(html_entity_decode($info['query']), $query);
|
parse_str(html_entity_decode($info['query']), $query);
|
||||||
@@ -240,6 +241,11 @@ class Request
|
|||||||
} elseif (!empty($params)) {
|
} elseif (!empty($params)) {
|
||||||
$queryString = http_build_query($params, '', '&');
|
$queryString = http_build_query($params, '', '&');
|
||||||
}
|
}
|
||||||
|
if ($queryString) {
|
||||||
|
parse_str($queryString, $get);
|
||||||
|
$options['get'] = isset($options['get']) ? array_merge($get, $options['get']) : $get;
|
||||||
|
}
|
||||||
|
|
||||||
$server['REQUEST_URI'] = $info['path'] . ('' !== $queryString ? '?' . $queryString : '');
|
$server['REQUEST_URI'] = $info['path'] . ('' !== $queryString ? '?' . $queryString : '');
|
||||||
$server['QUERY_STRING'] = $queryString;
|
$server['QUERY_STRING'] = $queryString;
|
||||||
$options['cookie'] = $cookie;
|
$options['cookie'] = $cookie;
|
||||||
|
|||||||
Reference in New Issue
Block a user