コード例 #1
0
ファイル: Page.php プロジェクト: kdambekalns/framework-benchs
 /**
  * 
  * Sets a Content-Type header in the response based on $this->_format,
  * but only if the response does not already have a Content-Type set.
  * 
  * @return void
  * 
  */
 protected function _setContentType()
 {
     if ($this->_response->getHeader('Content-Type')) {
         return;
     }
     // get the current format (the _fixFormat() method will have set the
     // default already, if needed)
     $format = $this->_format;
     // do we have a content-type for the format?
     if (!empty($this->_format_type[$format])) {
         // yes, retain the content-type
         $val = $this->_format_type[$format];
         // add charset if one exists
         if ($this->_charset) {
             $val .= '; charset=' . $this->_charset;
         }
         // set the response header for content-type
         $this->_response->setHeader('Content-Type', $val);
     }
 }
コード例 #2
0
ファイル: Chromephp.php プロジェクト: kalkin/solarphp
 /**
  * 
  * Sets the log message in the response headers.
  * 
  * @param string $data The JSON data for the header.
  *
  * @param int $type 3 - normal, 2 - dump
  * 
  * @return void
  * 
  */
 protected function _setHeader($data, $type = 3)
 {
     $utime = explode(' ', microtime());
     $utime = substr($utime[1], 7) . substr($utime[0], 2);
     $this->_response->setHeader("X-FirePHP-Data-{$type}{$utime}", "{$data},");
 }
コード例 #3
0
ファイル: Firephp.php プロジェクト: kalkin/solarphp
 /**
  * 
  * Sets the log message in the response headers.
  * 
  * @param string $data The JSON data for the header.
  *
  * @param int $type 3 - normal, 2 - dump
  * 
  * @return void
  * 
  */
 protected function _setHeader($data)
 {
     $this->_response->setHeader("X-Wf-1-1-1-" . $this->_count, "{$data}");
     $this->_count++;
 }