Example #1
0
 public final function output($return = false)
 {
     ob_start();
     if ($this->cache_ctl) {
         $this->cache_ctl->output();
     }
     $this->display_self();
     $data = ob_get_clean();
     //display_self 中包含来view才能得到view中设置的master view数据
     if ($this->check_master()) {
         return $this->output_master($data, $return);
     }
     if ($return) {
         return $data;
     }
     echo $data;
 }
Example #2
0
 public function check_request(YZE_HttpCache $cache)
 {
     if (!$cache) {
         return;
     }
     if ($cache->last_modified() && @$this->get_from_server('HTTP_IF_MODIFIED_SINCE')) {
         if (strtotime($cache->last_modified()) == strtotime($this->get_from_server('HTTP_IF_MODIFIED_SINCE'))) {
             throw new YZE_Not_Modified_Exception();
         }
     }
     if ($cache->etag() && @$this->get_from_server('HTTP_IF_NONE_MATCH')) {
         if (strcasecmp($cache->etag(), $this->get_from_server('HTTP_IF_NONE_MATCH')) == 0) {
             throw new YZE_Not_Modified_Exception();
         }
     }
 }