Reverted response handling.

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

@ -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;
self::$sent = true;
} }
return $this; exit($this->body);
} }
} }

Loading…
Cancel
Save