/** * Sends the response headers and body. * * @return void */ public function send() { if ($this->sent) { return; } ob_get_level() and ob_start(); if (!isset($this->status)) { $this->status = $this->hasHeader('Location') ? 302 : http_response_code(); } Util::sendStatus($this->status); $this->sendHeaders(); if ($this->send_body) { echo $this->body; } ob_get_level() and ob_flush(); $this->sent = true; }
/** * Sends response status code, as well as an additional "Status" header. * * @param int $code HTTP status code to send * @return void */ function http_send_status($code) { Util::sendStatus($code); }