$this->request = $req;
$this->response = $res;
$this->baseUrl = $baseUrl;
+ ob_start($res);
}
function esc($txt) {
private function serveCanonical($cnn) {
$this->response->setHeader("Location", $this->baseUrl->mod(["path" => $cnn]));
$this->response->setResponseCode(301);
+ $this->response->send();
}
/**
*/
private function serveStylesheet() {
$this->response->setHeader("Content-Type", "text/css");
- $this->esponse->setBody(new \http\Message\Body(fopen(ROOT."/public/index.css", "r")));
+ $this->response->setBody(new \http\Message\Body(fopen(ROOT."/public/index.css", "r")));
+ $this->response->send();
}
/**
private function serveJavascript() {
$this->response->setHeader("Content-Type", "application/javascript");
$this->response->setBody(new \http\Message\Body(fopen(ROOT."/public/index.js", "r")));
+ $this->response->send();
}
/**
private function serve() {
extract((array) func_get_arg(0));
include ROOT."/views/layout.phtml";
+ $this->response->send();
}
public function handle() {
$reference = new Reference(($refs = getenv("REFPATH")) ? explode(PATH_SEPARATOR, $refs) : glob(ROOT."/refs/*"));
$action = new Action($reference, new Request, new Response, new BaseUrl);
-
-ob_start($response);
$action->handle();
-ob_end_flush();
-$response->send();