Commit 76961859 authored by Luc Dehand's avatar Luc Dehand

Rename httrequest on resthttprequest

parent f87c3675
......@@ -41,7 +41,7 @@ class DefaultRootResource implements RESTRootResource {
* Constructor
* @param HttpRequest $pReq request
*/
public function __construct(HttpRequest $pReq) {
public function __construct(RESTHttpRequest $pReq) {
$this->request = $pReq;
}
......
......@@ -55,7 +55,7 @@ class RESTC
* @param HttpRequest $pRootResource root resource
* @param HttpRequest $pRealm name of the application
*/
public function __construct(HttpRequest $pReq, $pRootResource, $pRealm) {
public function __construct(RESTHttpRequest $pReq, $pRootResource, $pRealm) {
$this->request = $pReq;
// we compute the list of resources classes
$this->listResources = ServiceEnumerator::listDefinedResources();
......
......@@ -63,7 +63,7 @@ class RESTException extends Exception
public function sendError() {
$message = $this->getMessage();
$code = $this->getStatusCode();
header("HTTP/1.0 ".httpStatus::getMessage($code));
header("HTTP/1.0 ".HttpStatus::getMessage($code));
foreach ($this->getAdditionalHeaders() as $k => $v) {
header($k.': '.$v, false);
}
......
......@@ -25,7 +25,7 @@
* @package REST
* @author Luc Dehand - Alain Vagner
*/
class HttpRequest {
class RESTHttpRequest {
/**
* data passed to the REST web service
......@@ -62,7 +62,7 @@ class HttpRequest {
* @param string $pPathInfo overrides server path_info (optional)
*/
function __construct($pPathInfo = null) {
$this->input = file_get_contents('php://input');
$this->input = file_get_contents('php://input');
$this->method = strtoupper($_SERVER['REQUEST_METHOD']);
$headers = apache_request_headers();
$this->content_type = (isset($headers['Content-Type']))?$headers['Content-Type']:'';
......
......@@ -25,14 +25,14 @@
* @package REST
* @author Luc Dehand - Alain Vagner
*/
interface restresource {
interface RESTResource {
/**
* Constructor
* @param HttpRequest $pReq request
* @param string $pExt extension
* @param array $pConstraints list of constraints on this resource
*/
public function __construct(HttpRequest $pReq, $pExt = null, $pConstraints = array());
public function __construct(RESTHttpRequest $pReq, $pExt = null, $pConstraints = array());
/**
* authentication
......
......@@ -30,7 +30,7 @@ interface RESTRootResource {
* Constructor
* @param HttpRequest $pReq request
*/
public function __construct(HttpRequest $pReq);
public function __construct(RESTHttpRequest $pReq);
/**
* authentication
......
......@@ -2,8 +2,8 @@
require_once dirname(__FILE__) ."/../includes/common.php";
$app_name = 'test web service';
try {
$re = new HttpRequest();
$root = new DefaultRootResource($re);
$re = new RESTHttpRequest();
$root = new DefaultRootResource($re);
$fc = new RESTC($re, $root, $app_name);
$fc->dispatch();
} catch (RESTException $e) {
......
......@@ -2,8 +2,8 @@
require_once dirname(__FILE__) ."/../includes/common.php";
$app_name = 'test web service';
try {
$re = new HttpRequest();
$root = new DefaultRootResource($re);
$re = new RESTHttpRequest();
$root = new DefaultRootResource($re);
$fc = new RESTC($re, $root, $app_name);
$fc->dispatch();
} catch (RESTException $e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment