本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: deleteMultiByKey
/**
* @inheritdoc
*/
public function deleteMultiByKey($server_key, $keys, $time = null)
{
$keys = $this->prefixArrayOfKeys($keys);
return parent::deleteByKey($server_key, $keys, $time);
}