31 lines
736 B
PHP
31 lines
736 B
PHP
|
<?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;
|
||
|
}
|
||
|
}
|