Beispiel #1
0
 /**
  * 删除指定key的缓存数据
  * @param string $key
  * @return boolean
  */
 public function delete($key)
 {
     try {
         return $this->driver->delete($key);
     } catch (Exception $e) {
         $this->last_error_msg = $e->getMessage();
         $this->last_error_no = $e->getCode();
         return false;
     }
 }
Beispiel #2
0
 /**
  * 删除指定key的缓存数据
  * @param string $key
  * @param fiexd $value
  */
 public function delete($key)
 {
     if (true !== $key && $this->config['prefix']) {
         # 加前缀
         if (is_array($key)) {
             foreach ($key as &$item) {
                 $item = $this->config['prefix'] . $item;
             }
         } else {
             $key = $this->config['prefix'] . $key;
         }
     }
     try {
         return $this->driver->delete($key);
     } catch (Exception $e) {
         return false;
     }
 }