From ead3cdee852447f1e3ed2859ee520907da1957f4 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 31 May 2016 16:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 50 +++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index 325d7625..ff17f42b 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -709,16 +709,6 @@ class Request return $ip[$type]; } - /** - * 获取用户agent信息 - * @access public - * @return string - */ - public function agent() - { - return $this->server('HTTP_USER_AGENT'); - } - /** * 检测是否使用手机访问 * @access public @@ -739,6 +729,46 @@ class Request } } + /** + * 获取请求的user agent信息 + * @access public + * @return string + */ + public function agent() + { + return $this->server('HTTP_USER_AGENT'); + } + + /** + * 获取请求的accept encoding + * @access public + * @return string + */ + public function encode() + { + return $this->server('HTTP_ACCEPT_ENCODING'); + } + + /** + * 获取请求的accept language + * @access public + * @return string + */ + public function language() + { + return $this->server('HTTP_ACCEPT_LANGUAGE'); + } + + /** + * 获取请求的cache control + * @access public + * @return string + */ + public function cache() + { + return $this->server('HTTP_CACHE_CONTROL'); + } + /** * 当前URL地址中的scheme参数 * @access public