public function run() {
/*
* wrap uri in a decorator
*/
$uri = new URI(trim(str_replace($this->base_path, "", $_SERVER["REQUEST_URI"]), "/"));
/*
* fetch appropriate resource from uri
*/
$this->resource = new Resource($uri);
/*
* prepare the request
*/
$request = new Request;
/*
* get the response of the app based on the request
*/
$response = $this->getResponse($request);
/*
* send response headers
*/
$response.sendHeaders();
/*
* send response body
*/
echo $response;
}
This is a "run" function for a web app framework I'm writing. Does my logic of request and response make sense? I'm not actually formally educated with programming. I just read a lot.