|
@@ -12,8 +12,9 @@ class Request
|
|
|
protected $url = null;
|
|
protected $url = null;
|
|
|
protected $protocol = null;
|
|
protected $protocol = null;
|
|
|
|
|
|
|
|
- protected $client_ip = null;
|
|
|
|
|
protected $route = null;
|
|
protected $route = null;
|
|
|
|
|
+ protected $client_ip = null;
|
|
|
|
|
+ protected $user_agent = null;
|
|
|
|
|
|
|
|
public $GET = null;
|
|
public $GET = null;
|
|
|
public $POST = null;
|
|
public $POST = null;
|
|
@@ -93,6 +94,10 @@ class Request
|
|
|
$request->SERVER['SERVER_NAME'] = $request->SERVER['HTTP_X_FORWARDED_HOST'];
|
|
$request->SERVER['SERVER_NAME'] = $request->SERVER['HTTP_X_FORWARDED_HOST'];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Set Client User-Agent
|
|
|
|
|
+ $user_agent = isset($request->SERVER['HTTP_USER_AGENT']) ? $request->SERVER['HTTP_USER_AGENT'] : null;
|
|
|
|
|
+ $request->setUserAgent($user_agent);
|
|
|
|
|
+
|
|
|
// Set Client IP
|
|
// Set Client IP
|
|
|
$client_ip = null;
|
|
$client_ip = null;
|
|
|
if (! empty($request->SERVER['REMOTE_ADDR'])) {
|
|
if (! empty($request->SERVER['REMOTE_ADDR'])) {
|
|
@@ -127,6 +132,16 @@ class Request
|
|
|
$this->client_ip = $client_ip;
|
|
$this->client_ip = $client_ip;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function getUserAgent()
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->user_agent;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function setUserAgent($user_agent)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->user_agent = $user_agent;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function getRoute()
|
|
public function getRoute()
|
|
|
{
|
|
{
|
|
|
return $this->route;
|
|
return $this->route;
|