diff options
author | xue <> | 2006-02-07 19:05:33 +0000 |
---|---|---|
committer | xue <> | 2006-02-07 19:05:33 +0000 |
commit | 60e486b5697030d18311f67de29b95a892c7d95d (patch) | |
tree | b61991b7a3b419d586980ef9a5ad318c1429b4ea /framework/Web/THttpResponse.php | |
parent | ee2e653ec9da8cc311989acf6b21b78d32cc80c3 (diff) |
Added UrlFormat property to THttpRequest.
Diffstat (limited to 'framework/Web/THttpResponse.php')
-rw-r--r-- | framework/Web/THttpResponse.php | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index ea41ab16..d51c0cf2 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -274,24 +274,25 @@ class THttpResponse extends TModule implements ITextWriter */
public function flush()
{
- $header = $this->getContentTypeHeader();
- $this->appendHeader($header);
+ Prado::trace("Flushing output",'System.Web.THttpResponse');
+ $this->sendContentTypeHeader();
if($this->_bufferOutput)
ob_flush();
- Prado::trace("Flushing output $header",'System.Web.THttpResponse');
}
/**
- * @return string content type and charset header
+ * Sends content type header if charset is not empty.
*/
- protected function getContentTypeHeader()
+ protected function sendContentTypeHeader()
{
- $app = $this->getApplication()->getGlobalization();
$charset = $this->getCharset();
- if(empty($charset))
- $charset = !is_null($app) ? $app->getCharset() : 'UTF-8';
- $type = $this->getContentType();
- return "Content-Type: $type; charset=$charset";
+ if(empty($charset) && ($globalization=$this->getApplication()->getGlobalization())!==null)
+ $charset = $globalization->getCharset();
+ if(!empty($charset))
+ {
+ $header='Content-Type: '.$this->getContentType().';charset='.$charset;
+ $this->appendHeader($header);
+ }
}
/**
@@ -310,14 +311,10 @@ class THttpResponse extends TModule implements ITextWriter */
public function appendHeader($value)
{
+ Prado::trace("Sending header '$value'",'System.Web.THttpResponse');
header($value);
}
- public function sendContentTypeHeader($type=null)
- {
-
- }
-
/**
* Writes a log message into error log.
* This method is simple wrapper of PHP function error_log.
|