Commit initial
This commit is contained in:
31
server/webplatform/apps/CameraMonitor/Framework/Request.php
Normal file
31
server/webplatform/apps/CameraMonitor/Framework/Request.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
require_once $GLOBALS['app_path'].'Framework/Session.php';
|
||||
|
||||
class Request {
|
||||
|
||||
private $parameters;
|
||||
private $session;
|
||||
|
||||
|
||||
public function __construct($parameters) {
|
||||
$this->parameters = $parameters;
|
||||
$this->session = new Session();
|
||||
}
|
||||
|
||||
public function existParameter($nom) {
|
||||
return (isset($this->parameters[$nom]) && $this->parameters[$nom] != "");
|
||||
}
|
||||
|
||||
public function getParameter($nom) {
|
||||
if ($this->existParameter($nom)) {
|
||||
return $this->parameters[$nom];
|
||||
}
|
||||
else
|
||||
throw new Exception("Paramètre '$nom' absent de la requête");
|
||||
}
|
||||
|
||||
public function getSession(){
|
||||
return $this->session;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user