本文整理汇总了PHP中Memcache::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Memcache::delete方法的具体用法?PHP Memcache::delete怎么用?PHP Memcache::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Memcache
的用法示例。
在下文中一共展示了Memcache::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Delete an item from the memcache server
*
* @param string $key
* @return
*/
public function delete($key)
{
if (!$this->hasMemcache) {
return false;
}
return $this->memcache->delete($key);
}
示例2: delete
function delete($key)
{
if (null === $this->memcache) {
$this->connect();
}
return $this->memcache->delete($key);
}
示例3: dropAll
public function dropAll()
{
foreach ($this->cache->get(self::INTERNAL_PREFIX . 'all-keys') as $key) {
$this->drop($key);
}
$this->cache->delete(self::INTERNAL_PREFIX . 'all-data');
}
示例4: remove
public function remove($key)
{
if (\Kalibri::config()->get('debug.log.is-enabled', false)) {
\Kalibri::logger()->add(\Kalibri\Logger\Base::L_DEBUG, 'REMOVE: ' . $key, $this);
}
unset($this->_local[$key]);
return $this->_memcache->delete($key);
}
示例5: delete
/**
* Remove values from cache.
*
* @param array $keys list of keys to delete
*
* @return bool true on success, false on failure
*/
protected function delete(array $keys)
{
foreach ($keys as $k) {
$k = sha1($k);
$this->memcache->delete($k);
}
return true;
}
示例6: releaseLock
/**
* Release lock
*
* @param string $name name of lock
* @return bool
*/
public function releaseLock($name)
{
if (isset($this->keys[$name]) && $this->memcache->delete($name)) {
unset($this->keys[$name]);
return true;
}
return false;
}
示例7: removeTag
/**
* @inheritdoc
*/
public function removeTag($tag)
{
$tag = $this->prepareTag($tag);
if (($value = $this->storage->get($tag)) === false) {
return false;
}
$value = $this->unserialize($value);
$value[] = $tag;
foreach ($value as $key) {
$this->storage->delete($key);
}
return true;
}
示例8: delete
/**
* Delete cache item with given key
* @param string $key
*/
public function delete($key)
{
if (empty($key)) {
throw new InvalidArgumentException("\$key is empty");
}
return $this->memcache->delete($key);
}
示例9: remove
/**
* Removes a cache record.
*
* @param string $id Cache id
*
* @return boolean TRUE if cache is removed FALSE otherwise
*/
public function remove($id)
{
if (false === $this->_cache->delete($id)) {
return $this->_onError('remove');
}
return true;
}
示例10: expire
/**
* 设定该k一个过期时间
* @param int $expire 在$expire秒后过期
*/
public function expire($expire)
{
if ($expire <= 0) {
return FALSE;
}
return $this->mc->delete($this->k, $expire);
}
示例11: delete
/**
* Attempt to remove a key value pair from memcache.
*
* @param string $key index to remove from memcache
* @param int $delay - Length of time before deletion. (0 = immediately; n = seconds)
* @return bool
**/
public function delete($key, $delay = 0)
{
if ($this->open()) {
return $this->memcache->delete($key, $delay);
}
return false;
}
示例12: Delete
/**
* @param string $sKey
*
* @return void
*/
public function Delete($sKey)
{
if ($this->oMem)
{
$this->oMem->delete($this->generateCachedKey($sKey));
}
}
示例13: destroy
/**
* destroy of the session
*
* @param string $sessionId
* @return bool
*/
public function destroy($sessionId)
{
$this->_memcache->delete(Kwf_Cache_Simple::getUniquePrefix() . 'sess-' . $sessionId);
$this->_memcache->delete(Kwf_Cache_Simple::getUniquePrefix() . 'sess-db-' . $sessionId);
Kwf_Registry::get('db')->query("DELETE FROM kwf_sessions WHERE sessionId=?", $sessionId);
return true;
}
示例14: _deleteMulti
/**
* Simulates multiDelete operation, since Memcache extension does not support
*
* {@inheritDoc}
*
* @see http://www.php.net/manual/en/memcache.delete.php
*/
protected function _deleteMulti(array $keys)
{
foreach ($keys as $key) {
$this->_connection->delete($key);
}
return true;
}
示例15: destroy
/**
* Destroy a session.
* Expects a session id.
* @param string $sessionId
* @return boolean
*/
public function destroy($sessionId = '')
{
if ($sessionId !== '') {
$this->_memcache->delete($this->_key($sessionId));
}
return true;
}