Example #1
0
 /**
  * Sends all headers prior to returning the string
  *
  * @access public
  * @param boolean 	$compress	If true, compress the data
  * @return string
  */
 function toString($compress = false)
 {
     $data = JResponse::getBody();
     // Don't compress something if the server is going todo it anyway. Waste of time.
     if ($compress && !ini_get('zlib.output_compression') && ini_get('output_handler') != 'ob_gzhandler') {
         $data = JResponse::_compress($data);
     }
     if (JResponse::allowCache() === false) {
         JResponse::setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true);
         // Expires in the past
         JResponse::setHeader('Last-Modified', gmdate("D, d M Y H:i:s") . ' GMT', true);
         // Always modified
         JResponse::setHeader('Cache-Control', 'no-store, no-cache, must-revalidate', true);
         // Extra CYA
         JResponse::setHeader('Cache-Control', 'post-check=0, pre-check=0', false);
         // HTTP/1.1
         JResponse::setHeader('Pragma', 'no-cache');
         // HTTP 1.0
     }
     JResponse::sendHeaders();
     return $data;
 }
Example #2
0
 function endOutput(&$menus)
 {
     echo "</urlset>\n";
     if ($this->doCompression) {
         $data = ob_get_contents();
         @ob_end_clean();
         echo JResponse::_compress($data);
     }
 }