|
|
|
@ -29,11 +29,6 @@ class Response {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected $body;
|
|
|
|
protected $body;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @var bool If a response has already been sent
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
protected static $sent = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @var array HTTP status codes
|
|
|
|
* @var array HTTP status codes
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -214,25 +209,17 @@ class Response {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sends a HTTP response.
|
|
|
|
* Sends a HTTP response.
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return object Self reference
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function send() {
|
|
|
|
public function send() {
|
|
|
|
if (ob_get_length() > 0) {
|
|
|
|
if (ob_get_length() > 0) {
|
|
|
|
ob_end_clean();
|
|
|
|
ob_end_clean();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!self::$sent) {
|
|
|
|
|
|
|
|
if (!headers_sent()) {
|
|
|
|
if (!headers_sent()) {
|
|
|
|
$this->sendHeaders();
|
|
|
|
$this->sendHeaders();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo $this->body;
|
|
|
|
exit($this->body);
|
|
|
|
|
|
|
|
|
|
|
|
self::$sent = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|