[TASK] Moved RouterException. Readded lost stuff from Request.

This commit is contained in:
Simon Sessingø
2016-03-19 16:27:25 +01:00
parent 6395801a06
commit 1bafbab56b
7 changed files with 18 additions and 7 deletions
+11 -5
View File
@@ -6,11 +6,6 @@ class Request {
protected static $instance;
protected $data;
protected $uri;
protected $host;
protected $method;
protected $headers;
protected $loadedRoute;
/**
* Return new instance
@@ -136,6 +131,17 @@ class Request {
return (isset($_REQUEST[$name]) ? $_REQUEST[$name] : $defaultValue);
}
public function isFormatAccepted($format) {
return (isset($_SERVER['HTTP_ACCEPT']) && stripos($_SERVER['HTTP_ACCEPT'], $format) > -1);
}
public function getAcceptFormats() {
if(isset($_SERVER['HTTP_ACCEPT'])) {
return explode(',', $_SERVER['HTTP_ACCEPT']);
}
return array();
}
public function __set($name, $value = null) {
$this->data[$name] = $value;
}