Reverted response handling.

Caused too many conflicts with other methods. Clean up should be done before the stop method is called.
v1
Mike Cao 13 years ago
parent 6a1029a187
commit 30195237e5

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

Loading…
Cancel
Save