Пример #1
0
 public function get($offset)
 {
     if (!array_key_exists($offset, $this->_pool)) {
         if (!isset($this->_waitingKeys[$offset])) {
             $this->_waitingKeys[$offset] = null;
             $this->_adapter->preloadFromCache($offset, $this);
         }
         $this->_adapter->flushCache();
         if (!array_key_exists($offset, $this->_pool)) {
             //Cache Miss $ Save
             //    在php的数组缓存中没有找到,再去mysql中找
             $this->_loadFromDb();
         }
     }
     return $this->_pool[$offset];
 }