Exemple #1
0
 protected static function reset()
 {
     $_GET = array();
     $_POST = array();
     $_REQUEST = array();
     $_SERVER = array();
     $_SESSION = \Lysine\Session::getInstance();
     resp()->reset();
 }
Exemple #2
0
 public function request($uri = '/', $method = 'GET', array $params = array())
 {
     resp()->reset();
     $_GET = $_POST = $_REQUEST = $_SERVER = $_COOKIE = array();
     $_SESSION = \Lysine\Session::getInstance();
     $uri = parse_url($uri);
     $this->path = $uri['path'];
     $method = strtoupper($method);
     $_SERVER['REQUEST_URI'] = $uri;
     $_SERVER['REQUEST_METHOD'] = $method;
     if (isset($uri['query'])) {
         $_SERVER['QUERY_STRING'] = $uri['query'];
         parse_str($uri['query'], $_GET);
     }
     if ($method == 'GET') {
         $_GET = $params;
     } else {
         $_POST = $params;
     }
     $this->cookie->apply($this->path);
     $_REQUEST = array_merge($_GET, $_POST, $_COOKIE);
 }
Exemple #3
0
 public function reset()
 {
     $this->code = \Lysine\HTTP::OK;
     $this->header = array();
     $this->cookie = array();
     $this->body = null;
     \Lysine\Session::getInstance()->reset();
     return $this;
 }
Exemple #4
0
 protected function tearDown()
 {
     \Lysine\Session::getInstance()->destroy();
     unset($_SESSION);
 }