Example #1
0
 /**
  * Render current headers
  */
 public function renderHeaders()
 {
     header("HTTP/1.0 " . $this->_http_status);
     /* headers to stop caching in browsers and proxies */
     header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     // Date in the past
     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
     // always modified
     header("Cache-Control: no-cache, must-revalidate");
     // HTTP/1.1
     header("Pragma: no-cache");
     // HTTP/1.0
     if (Context::isDebugMode()) {
         header("x-tbg-debugid: " . Context::getDebugID());
         $load_time = Context::getLoadTime();
         $load_time = $load_time >= 1 ? round($load_time, 2) . 's' : round($load_time * 1000, 1) . 'ms';
         header("x-tbg-loadtime: " . $load_time);
     }
     if (Context::isI18nInitialized()) {
         header("Content-Type: " . $this->_content_type . "; charset=" . Context::getI18n()->getCharset());
     } else {
         header("Content-Type: " . $this->_content_type . "; charset=utf-8");
     }
     foreach ($this->_headers as $header) {
         header($header);
     }
 }