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;
}
Bu ben yazıyorum bir web uygulaması çerçevesi için bir "çalışma" işlevidir. Istek ve yanıt benim mantık mantıklı mı? Aslında resmen programlama ile eğitimli değilim. Ben sadece çok okudum.