X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=mdref%2FAction.php;h=05e007fe37b0ea176dda8d9be8b738c2e273294e;hb=904fc60f05894d6207e9ae85abda8c94283f7d28;hp=e35b3f5f43bf5f2b9d59141e8cbcb70835cf2011;hpb=fc6b583627d21a26de8268df800fd44fbb9ac30d;p=mdref%2Fmdref diff --git a/mdref/Action.php b/mdref/Action.php index e35b3f5..05e007f 100644 --- a/mdref/Action.php +++ b/mdref/Action.php @@ -38,6 +38,7 @@ class Action { $this->request = $req; $this->response = $res; $this->baseUrl = $baseUrl; + ob_start($res); } function esc($txt) { @@ -72,6 +73,7 @@ class Action { private function serveCanonical($cnn) { $this->response->setHeader("Location", $this->baseUrl->mod(["path" => $cnn])); $this->response->setResponseCode(301); + $this->response->send(); } /** @@ -79,7 +81,8 @@ class Action { */ 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(); } /** @@ -88,6 +91,7 @@ class Action { 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(); } /** @@ -103,10 +107,10 @@ class Action { $pld->text = file_get_contents(ROOT."/$pld->ref"); break; case "index.css": - $this->serveStylesheet($ctl); + $this->serveStylesheet(); break; case "index.js": - $this->serveJavascript($ctl); + $this->serveJavascript(); break; default: throw new Exception(404, "$pld->ref not found"); @@ -116,6 +120,7 @@ class Action { private function serve() { extract((array) func_get_arg(0)); include ROOT."/views/layout.phtml"; + $this->response->send(); } public function handle() {