当前位置: 首页>>代码示例>>PHP>>正文


PHP Memcached::deleteByKey方法代码示例

本文整理汇总了PHP中Memcached::deleteByKey方法的典型用法代码示例。如果您正苦于以下问题:PHP Memcached::deleteByKey方法的具体用法?PHP Memcached::deleteByKey怎么用?PHP Memcached::deleteByKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Memcached的用法示例。


在下文中一共展示了Memcached::deleteByKey方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**
  * Remove the item from the cache.
  *
  * Remove an item from cache with identified by $key after $time seconds. The
  * $time parameter allows an object to be queued for deletion without immediately
  * deleting. Between the time that it is queued and the time it's deleted, add,
  * replace, and get will fail, but set will succeed.
  *
  * @link http://www.php.net/manual/en/memcached.delete.php
  *
  * @param   string      $key        The key under which to store the value.
  * @param   string      $group      The group value appended to the $key.
  * @param   int         $time       The amount of time the server will wait to delete the item in seconds.
  * @param   string      $server_key The key identifying the server to store the value on.
  * @param   bool        $byKey      True to store in internal cache by key; false to not store by key
  * @return  bool                    Returns TRUE on success or FALSE on failure.
  */
 public function delete($key, $group = 'default', $time = 0, $server_key = '', $byKey = false)
 {
     $derived_key = $this->buildKey($key, $group);
     // Remove from no_mc_groups array
     if (in_array($group, $this->no_mc_groups)) {
         if (isset($this->cache[$derived_key])) {
             unset($this->cache[$derived_key]);
         }
         return true;
     }
     $result = false !== $byKey ? $this->daemon->deleteByKey($server_key, $derived_key, $time) : $this->daemon->delete($derived_key, $time);
     $r_code = $this->getResultCode();
     if (Memcached::RES_SUCCESS === $r_code) {
         unset($this->cache[$derived_key]);
     }
     return $result;
 }
开发者ID:benediktharter,项目名称:wp-spider-cache,代码行数:34,代码来源:class-object-cache.php

示例2: deleteByKey

 /**
  * delete method multiserver pools
  *
  * @param $server_key string
  * @param $key        string
  * @param $time       int
  *
  * @return boolean
  */
 public function deleteByKey(string $server_key, string $key, int $time = 0) : bool
 {
     if (parent::deleteByKey($server_key, $key, $time ? $time : null)) {
         unset($this->cacheListing[$key]);
         $this->saveCacheListing();
         return true;
     }
     return false;
 }
开发者ID:chilimatic,项目名称:cache-component,代码行数:18,代码来源:Memcached.php

示例3: deleteByKey

 /**
  * delete method multiserver pools
  *
  * @param $server_key string            
  * @param $key string            
  * @param $time int            
  *
  * @return boolean
  */
 public function deleteByKey($server_key, $key, $time = 0)
 {
     if (parent::deleteByKey($server_key, $key, $time ? $time : NULL)) {
         unset($this->cache_listing[$key]);
         $this->save_cache_listing();
         return TRUE;
     }
     return FALSE;
 }
开发者ID:andreas83,项目名称:Videosharing,代码行数:18,代码来源:cachememcached.php

示例4: deleteMultiByKey

 /**
  * @inheritdoc
  */
 public function deleteMultiByKey($server_key, $keys, $time = null)
 {
     $keys = $this->prefixArrayOfKeys($keys);
     return parent::deleteByKey($server_key, $keys, $time);
 }
开发者ID:jonafrank,项目名称:memcached-manager,代码行数:8,代码来源:MemcachedHandler.php


注:本文中的Memcached::deleteByKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。