Example #1
0
File: data.php Project: jasny/Q
 /**
  * Helper function.
  * 
  * @param string $xml
  */
 protected static function outputXML($xml)
 {
     if (!headers_sent()) {
         if (isset($_SERVER['CONTENT_TYPE']) && preg_match('/^multipart\\/form-data;/i', $_SERVER['CONTENT_TYPE'])) {
             HTTP::header('Content-type: text/plain; charset=UTF-8');
         } else {
             HTTP::header('Content-type: text/xml; charset=UTF-8');
             echo '<?xml version="1.0" encoding="UTF-8" ?>', "\n";
         }
     }
     echo $xml;
 }
Example #2
0
 /**
  * Tests Log_Header in Zend_Log compatibility mode
  */
 public function testZendCompatible()
 {
     $this->Log_Header->zendCompatible = true;
     $this->Log_Header->info('This is a test');
     $this->assertEquals("This is a test", HTTP::header_getValue('X-Info-' . $this->getCounter()));
     $this->Log_Header->trick('Yet another test');
     $this->assertEquals("Yet another test", HTTP::header_getValue('X-Trick-' . $this->getCounter()));
 }