Example #1
0
 /**
  * Sets HTTP response headers and writes out the buffer.
  * @param Response $response Response to write out and to send to the client
  */
 protected static function output(Response $response)
 {
     header("HTTP/1.1 " . $response->getStatus());
     if ($response->getContentType() != null && $response->getCharacterEncoding() != null) {
         header("Content-Type: " . $response->getContentType() . "; charset=" . $response->getCharacterEncoding());
     }
     if ($response->getBuffer() != null) {
         print $response->getBuffer();
     }
     // exit
 }