From 3c03a42d1edb0ec26110ace00f42e156cabff67b Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 9 Dec 2006 09:17:22 +0000 Subject: Fixed #433, #384, #439, #477, #435, #422, #401, #359. Add more class docs for sqlmap. --- framework/Web/THttpResponse.php | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'framework/Web/THttpResponse.php') diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index 3a6d0aa3..3b8c0842 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -81,7 +81,7 @@ class THttpResponse extends TModule implements ITextWriter * @var THttpResponseAdapter adapter. */ private $_adapter; - + /** * Destructor. * Flushes any existing content in buffer. @@ -91,7 +91,7 @@ class THttpResponse extends TModule implements ITextWriter //if($this->_bufferOutput) // @ob_end_flush(); } - + /** * @param THttpResponseAdapter response adapter */ @@ -99,7 +99,7 @@ class THttpResponse extends TModule implements ITextWriter { $this->_adapter=$adapter; } - + /** * @return THttpResponseAdapter response adapter, null if not exist. */ @@ -107,7 +107,7 @@ class THttpResponse extends TModule implements ITextWriter { return $this->_adapter; } - + /** * @return boolean true if adapter exists, false otherwise. */ @@ -250,7 +250,7 @@ class THttpResponse extends TModule implements ITextWriter { echo $str; } - + /** * Sends a file back to user. * Make sure not to output anything else after calling this method. @@ -313,6 +313,19 @@ class THttpResponse extends TModule implements ITextWriter * the current request will be inserted at the beginning. */ public function redirect($url) + { + if($this->getHasAdapter()) + $this->_adapter->httpRedirect($url); + else + $this->httpRedirect($url); + } + + /** + * Redirect the browser to another URL and exists the current application. + * @param string URL to be redirected to. If the URL is a relative one, the base URL of + * the current request will be inserted at the beginning. + */ + public function httpRedirect($url) { if(!$this->getApplication()->getRequestCompleted()) $this->getApplication()->onEndRequest(); @@ -342,7 +355,7 @@ class THttpResponse extends TModule implements ITextWriter else $this->flushContent(); } - + /** * Outputs the buffered content, sends content-type and charset header. */ @@ -351,7 +364,7 @@ class THttpResponse extends TModule implements ITextWriter Prado::trace("Flushing output",'System.Web.THttpResponse'); $this->sendContentTypeHeader(); if($this->_bufferOutput) - ob_flush(); + ob_flush(); } /** @@ -474,7 +487,7 @@ class THttpResponse extends TModule implements ITextWriter else return $this->createNewHtmlWriter($type, $this); } - + /** * Create a new html writer intance. * @param string type of HTML writer to be created. -- cgit v1.2.3