2012-02-08 23:14:28 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Request {
|
|
|
|
public $get = array();
|
|
|
|
public $post = array();
|
|
|
|
public $cookie = array();
|
|
|
|
public $files = array();
|
|
|
|
public $server = array();
|
|
|
|
public $fixed_request_uri = "";
|
|
|
|
|
|
|
|
|
|
|
|
public function __construct() {
|
2012-08-06 12:46:02 +02:00
|
|
|
$this->get = $_GET;
|
|
|
|
$this->post = $_POST;
|
|
|
|
$this->cookie = $_COOKIE;
|
|
|
|
$this->files = $_FILES;
|
|
|
|
$this->server = $_SERVER;
|
2012-02-08 23:14:28 +01:00
|
|
|
|
|
|
|
if(isset($_SERVER['REQUEST_URI'])) {
|
|
|
|
$this->fixed_request_uri = preg_replace("/\/([\w]+)\.php\?{0,1}/", "", $_SERVER['REQUEST_URI']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-08-02 16:33:14 +02:00
|
|
|
|
|
|
|
class Session {
|
|
|
|
|
|
|
|
public function __construct() {
|
2013-11-18 19:24:33 +01:00
|
|
|
session_start();
|
2013-08-02 16:33:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-11-18 19:24:33 +01:00
|
|
|
public function get($k = '') {
|
|
|
|
if($k && isset($_SESSION[$k])) { return $_SESSION[$k]; }
|
2013-08-02 16:33:14 +02:00
|
|
|
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function set($k = '', $v = '') {
|
|
|
|
|
|
|
|
if($k) { $_SESSION[$k] = $v; }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-11-18 19:24:33 +01:00
|
|
|
|
|
|
|
public function remove($k = '') {
|
|
|
|
if($k) { unset($_SESSION[$k]); }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-02 16:33:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-08 23:14:28 +01:00
|
|
|
?>
|