Beispiel #1
0
 public function fetch($key, $meta = false, $timestamp = false)
 {
     if ($this->_session_cache->isCached($key)) {
         self::$session_hit_count++;
         if (!$this->_file_cache->isCached($key)) {
             # sync file with session
             $this->_file_cache->save($key, $this->_session_cache->fetch($key));
         }
     } elseif ($this->_file_cache->isCached($key)) {
         self::$file_hit_count++;
         # sync session with file
         $this->_session_cache->save($key, $this->_file_cache->fetch($key));
     } else {
         self::$missed_count++;
         # no key found
         return NULL;
     }
     # we made sure that the $_SESSION & FILE is synced
     return $this->_session_cache->fetch($key, $meta, $timestamp);
 }