agent = new \Mammut\Info\UserAgent(); $this->param = array(); switch(strtoupper($_SERVER['REQUEST_METHOD'])) { case 'GET': $this->param = $_GET; break; case 'POST': $this->param = $_POST; break; } } /** * Returns the type of the request. * Possible values cloud be GET, PUT, POST and others, see http specs and the php docs * for details. * * @return string the request type */ public function getType() { return strtoupper($_SERVER['REQUEST_METHOD']); } /** * data fetching method, which returns the request parameter values * * @param $key string * optional key that should be returned. if none is given, the whole array * will be returned * @return mixed the parameter array given by the request, or the specific value if a * key is given */ public function getParam($key = NULL) { if(!is_null($key)) return $this->param[(string) $key]; return $this->param; } public function update($key, $value) { $this->param[$key] = $value; } public function getUserAgent() { return $this->agent; } public function isValid() { return true; } }