mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
改进Request类
This commit is contained in:
@@ -709,16 +709,6 @@ class Request
|
|||||||
return $ip[$type];
|
return $ip[$type];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户agent信息
|
|
||||||
* @access public
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function agent()
|
|
||||||
{
|
|
||||||
return $this->server('HTTP_USER_AGENT');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测是否使用手机访问
|
* 检测是否使用手机访问
|
||||||
* @access public
|
* @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参数
|
* 当前URL地址中的scheme参数
|
||||||
* @access public
|
* @access public
|
||||||
|
|||||||
Reference in New Issue
Block a user