Пример #1
0
 public function output()
 {
     if (empty($this->m_type)) {
         $this->m_type = 'text/plain';
     }
     $this->addHeader('Content-Type', $this->m_type . ($this->m_encoding ? '; charset=' . $this->m_encoding : null));
     ZHeaders::setCode($this->m_code, $this->m_message);
     foreach ($this->m_headers as $h) {
         $h->send();
     }
     echo $this->getContent();
 }
Пример #2
0
 /**
  * Send header now
  * @return ZResponse
  */
 public function &send_headers()
 {
     ZHeaders::setCode($this->m_code, $this->m_message);
     foreach ($this->m_headers as $h) {
         $h->send();
     }
     return $this;
 }
Пример #3
0
 /**
  * Output responce
  */
 public function output()
 {
     if (empty($this->m_type)) {
         $this->m_type = 'text/plain';
     }
     $this->addHeader('Content-Type', $this->m_type . ($this->m_encoding ? '; charset=' . $this->m_encoding : null));
     if ($this->m_cache == false) {
         $this->addHeaders(array('Date' => gmdate(DATE_RFC822, time()) . ' GMT', 'Expires' => 'Fri, 01 Jan 1990 00:00:00 GMT', 'Pragma' => 'no-cache', 'Cache-Control' => 'no-cache, must-revalidate'));
     }
     if ($this->m_code == 302 || $this->m_cache == 307) {
         $this->addHeaders(array('Date' => null, 'Expires' => null, 'Pragma' => null, 'Cache-Control' => null));
     }
     $this->addHeader('Content-length', $this->getContentLength());
     ZHeaders::setCode($this->m_code, $this->m_message);
     foreach ($this->m_headers as $h) {
         $h->send();
     }
     echo $this->m_content;
 }