[TASK] Added getUserAgent and getReferer methods to Request class.

This commit is contained in:
Simon Sessingø
2015-10-22 21:04:52 +02:00
parent 6c7ac2b250
commit b8061f2aa7
+16
View File
@@ -68,6 +68,22 @@ class Request {
return isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
}
/**
* Get referer
* @return string
*/
public function getReferer() {
return isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
}
/**
* Get user agent
* @return string
*/
public function getUserAgent() {
return isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
}
/**
* Get header value by name
* @param string $name