* @package Mammut\Protocol */ class HTTP extends \Mammut\StrictObject { private static $instance = false; private $request; private $respose; public function __construct($request = false) { if($request) $this->request = $request; else $this->request = self::$instance->getRequest(); } /** * returns the instance that represents the active http request */ public static function getInstance() { if(self::$instance === false) { self::$instance = new HTTP(); self::$instance->request = new Request(); self::$instance->response = new Response(); } return self::$instance; } public function getRequest() { return $this->request; } public function getReponse() { return $this->respose; } }