提交 3c627dbc 编写于 作者: lzc828's avatar lzc828

default value

上级 1ed1767e
......@@ -27,11 +27,11 @@ class Request
public function __construct()
{
$this->server = &$_SERVER;
$this->cookie = &$_COOKIE;
$this->get = &$_GET;
$this->post = &$_POST;
$this->files = &$_FILES;
$this->server = &$_SERVER;
$this->cookie = &$_COOKIE;
$this->get = &$_GET;
$this->post = &$_POST;
$this->files = &$_FILES;
$this->request = &$_REQUEST;
}
......@@ -66,7 +66,7 @@ class Request
*/
public function uri()
{
$path = urldecode(array_get_not_null($this->server, ['REQUEST_URI', 'argv.1']));
$path = urldecode(array_get_not_null($this->server, ['REQUEST_URI', 'argv.1']));
$paths = explode('?', $path);
return '/' . trim($paths[0], '/');
}
......@@ -86,7 +86,7 @@ class Request
if ($key === null) {
return $arr;
}
return array_get($arr, $key);
return array_get($arr, $key, $default);
}
/**
......@@ -188,7 +188,7 @@ class Request
*/
public function isJson()
{
if ($this->server('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest' || strpos($this->server('HTTP_ACCEPT'),'/json') !== false) {
if ($this->server('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest' || strpos($this->server('HTTP_ACCEPT'), '/json') !== false) {
return true;
} else {
return false;
......
......@@ -10,6 +10,6 @@ if (!defined('_DEBUG_')) {
define('_DEBUG_', false);
}
define('_ONE_V_', '1.7.4');
define('_ONE_V_', '1.7.5');
require __DIR__ . '/helper.php';
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册