private function completeResponse(Response $response, $result) { // Todo PSR logging if ($this->debug) { echo date('r') . ": -> "; print_r($result); } if ($result instanceof ControllerResponse) { $result->send($response); } else { $result = Json::pretty($result); $response->writeHead(200, ['Content-Type' => 'application/json']); $response->end($result); } }
public function save() { $file = Json::pretty(['bootstrap' => $this->bootstrap, 'emitLevel' => $this->emitLevel]); file_put_contents($this->configFilename, $file); }