Source for file HttpRequest.php
Documentation is available at HttpRequest.php
* "THE BEER-WARE LICENSE" (Revision 42):
* "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
* As long as you retain this notice you can do whatever you want with
* this stuff. If we meet some day, and you think this stuff is worth it,
* you can buy me a beer in return.
* @package RequestResponse
* @copyright Copyright (c) 2007 Sven Strittmatter
require_once dirname(__FILE__ ). "/../Request.php";
* @see GenerallHttpHeaders
require_once dirname(__FILE__ ). "/GenerallHttpHeaders.php";
* Enter description here...
* @todo complete description
* @package RequestResponse
* @copyright Copyright (c) 2007 Sven Strittmatter
* @author "Sven Strittmatter" <ausserirdisch@sven-space.de>
* @link http://www.sven-space.de/code/php/MVClasses
class HttpRequest implements Request, GenerallHttpHeaders {
// Konstanten fuer den parameter type.
const GLOBALS_POST = "post";
const GLOBALS_GET = "get";
// konstanten fuer headers (http://www.bolege.de/http-header/#art2)
const HTTP_HEADER_ACCEPT = "Accept";
const HTTP_HEADER_ACCEPT_ENCODING = "Accept-Encoding";
const HTTP_HEADER_AUTHORIZATION = "Authorization";
const HTTP_HEADER_COOKIE = "Cookie";
const HTTP_HEADER_HOST = "Host";
const HTTP_HEADER_IF_MODIFIED_SINCE = "If-Modified-Since";
const HTTP_HEADER_PROXY_AUTHORIZATION = "Proxy-Authorization";
const HTTP_HEADER_RANGE = "Range";
const HTTP_HEADER_REFERER = "Referer";
const HTTP_HEADER_USER_AGENT = "User-Agent";
$this->_parameters[self::GLOBALS_POST] = $_POST;
$this->_parameters[self::GLOBALS_GET] = $_GET;
array_keys($this->_parameters[self::GLOBALS_POST]),
array_keys($this->_parameters[self::GLOBALS_GET]));
return isset ($this->_parameters[self::GLOBALS_GET][$name]);
return isset ($this->_parameters[self::GLOBALS_POST ][$name]);
public function getParameter($name, $type = self::GLOBALS_GET) {
return $this->_parameters[$type][$name];
if (isset ($_SERVER[$name])) {
if (!isset ($_SERVER['PHP_AUTH_USER'])) {
'username' => $_SERVER['PHP_AUTH_USER'],
'password' => $_SERVER['PHP_AUTH_PW']
return $_SERVER['REMOTE_ADDR'];
|