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


PHP Memcached::delete方法代码示例

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


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

示例1: tsli_save_post

 public function tsli_save_post($post_ID, $post, $update)
 {
     $memcache = new Memcached();
     $memcache->addServer('127.0.0.1', 11211);
     foreach ($post as $key => $value) {
         $memcache->delete(md5(json_encode(array("field" => $key, "id" => $post_ID, "type" => "tsli"))));
         $memcache->delete(md5(json_encode(array("field" => $key, "slug" => $post->post_name, "type" => "tsli"))));
     }
     $memcache->delete(md5(json_encode(array("type" => "tsli", "slug" => $post->post_name))));
     $memcache->delete(md5(json_encode(array("type" => "tsli", "id" => $post_ID))));
 }
开发者ID:ak-dev,项目名称:wp-plugins,代码行数:11,代码来源:nd-tsli.php

示例2: delete

 public function delete($key)
 {
     $key = $this->prefix . $key;
     $this->store->delete($key);
     $this->removeFromIndex($key);
     return $this;
 }
开发者ID:simon-downes,项目名称:spf,代码行数:7,代码来源:Memcache.php

示例3: release

 /**
  * 解锁
  * @param unknown $key
  */
 public function release($key)
 {
     $key = $this->prefix . $key;
     if ($this->memcached->get($key) === $this->Identifier) {
         $this->memcached->delete($key);
     }
 }
开发者ID:latrell,项目名称:lock,代码行数:11,代码来源:MemcachedStore.php

示例4: Delete

 /**
  * Delete an item from the cache
  *
  * @param string $key cache key
  */
 public function Delete($key)
 {
     if (empty($key)) {
         return;
     }
     $this->memcache->delete($key);
 }
开发者ID:hmcclungiii,项目名称:gitphp,代码行数:12,代码来源:Cache_Memcached.class.php

示例5: invalidate

 /**
  * @param string $name
  */
 public function invalidate($name)
 {
     if (!$this->memcached instanceof \Memcached) {
         $this->connect();
     }
     $this->memcached->delete($name);
 }
开发者ID:hergot,项目名称:databroker,代码行数:10,代码来源:MemcachedCacheBackend.php

示例6: delete

 function delete($key)
 {
     $key = str_replace('\\', '/', $key);
     if (!$this->memcached->delete($key)) {
         $message = sprintf('Memcache::delete() with key "%s" failed', $key);
         \ManiaLib\Utils\Logger::error($message);
     }
 }
开发者ID:kremsy,项目名称:manialib,代码行数:8,代码来源:Memcached.php

示例7: getCounter

 public function getCounter()
 {
     $memcached = new \Memcached();
     $memcached->addServer($GLOBALS['settings']['memcached']['host'], $GLOBALS['settings']['memcached']['port']);
     $memcached->delete('prefix/counter/value');
     $memcached->delete('prefix/counter/value2');
     return new \Cachet\Counter\Memcache($memcached, 'prefix');
 }
开发者ID:shabbyrobe,项目名称:cachet,代码行数:8,代码来源:MemcachePrefixTest.php

示例8: 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;
 }
开发者ID:socloz,项目名称:ninja-mutex,代码行数:14,代码来源:MemcacheLockAbstract.php

示例9: testLoadStatusEmpty

 public function testLoadStatusEmpty()
 {
     $this->_connection->delete('EjsmontCircuitBreakerAAAbbb');
     $this->assertEquals("", $this->_adapter->loadStatus('GGG', ''));
     $this->assertEquals("", $this->_adapter->loadStatus('AAA', 'bbb'));
     $this->_adapter->saveStatus('B', 'bbb', "");
     $this->assertEquals("", $this->_adapter->loadStatus('A', 'bbb'), 6);
     $this->assertEquals("", $this->_adapter->loadStatus('B', 'bbb'), 7);
 }
开发者ID:rockefys,项目名称:php-circuit-breaker,代码行数:9,代码来源:MemcachedAdapterTest.php

示例10: deleteArrayDataFromStorage

 /**
  * {@inheritdoc}
  */
 protected function deleteArrayDataFromStorage(array $keys)
 {
     $deleted = true;
     foreach ($keys as $key) {
         if ($this->memcached->delete($key) === false) {
             $deleted = false;
         }
     }
     return $deleted;
 }
开发者ID:tlumx,项目名称:framework,代码行数:13,代码来源:MemcachedCachePool.php

示例11: delete

 public function delete($key)
 {
     $this->memcachedObj->delete($key);
     $resultCode = $this->memcachedObj->getResultCode();
     if ($resultCode != \Memcached::RES_SUCCESS && $resultCode != \Memcached::RES_NOTFOUND) {
         throw new StorageException('[STORAGE] "' . $this->getStorageName() . '::delete" failed for key "' . $key . '"!' . ' StorageRespCode: ' . $resultCode);
     }
     unset($this->casArray[$key]);
     return $resultCode;
 }
开发者ID:fustundag,项目名称:tokenbucket,代码行数:10,代码来源:Memcached.php

示例12: doDelete

 /**
  * {@inheritdoc}
  */
 protected function doDelete($key, array $options = array())
 {
     $this->client->delete($this->getKey($key, $options));
     switch (true) {
         case $this->isSuccess():
             return new CacheResponse(true, true, true);
         case $this->isNotFound():
             return new CacheResponse(false, false, true, CacheResponse::RESOURCE_NOT_FOUND);
     }
     /* If everything failed we're dealing with a backend (connection) error. */
     return new CacheResponse(false, false, false, CacheResponse::CONNECTION_ERROR);
 }
开发者ID:ebidtech,项目名称:cache-client,代码行数:15,代码来源:MemcachedProviderService.php

示例13: process

 public function process()
 {
     $id = $this->get('id');
     $state = (string) $this->get('state');
     if (!$this->is_moderator()) {
         throw new ErrorApi(ErrorApi::INSUFFICIENT_RIGHTS);
     }
     if (empty($id) || empty($state)) {
         throw new ErrorApi(ErrorApi::MISSING_INPUT);
     }
     $state = Meta::parse($state);
     if (empty($state)) {
         throw new ErrorApi(ErrorApi::INCORRECT_INPUT);
     }
     $this->db->update('art', array('sortdate' => $this->db->unix_to_date()), $id);
     $this->remove_meta(Meta::ART, $id, Meta::STATE, Meta::STATE_APPROVED);
     $this->remove_meta(Meta::ART, $id, Meta::STATE, Meta::STATE_UNAPPROVED);
     $this->remove_meta(Meta::ART, $id, Meta::STATE, Meta::STATE_DISAPPROVED);
     $this->remove_meta(Meta::ART, $id, Meta::STATE, Meta::STATE_DELETED);
     $this->add_meta(Meta::ART, $id, Meta::STATE, $state);
     $cache = new \Memcached("access_checker");
     $cache->addServer("localhost", 11211);
     $cache->delete('is_pic_safe_' . $this->db->get_field('art', 'md5', $id));
     $this->set_success(true);
 }
开发者ID:4otaku,项目名称:api,代码行数:25,代码来源:Approve.php

示例14: _doDelete

 /**
  * Remove a cache record directly. This method is implemented by the cache
  * drivers and used in Doctrine_Cache_Driver::delete()
  *
  * @param string $id cache id
  * @return boolean true if no problem
  */
 protected function _doDelete($id)
 {
     if (false == $this->_memcached->getOption(Memcached::OPT_BINARY_PROTOCOL)) {
         $id = str_replace(' ', '_', $id);
     }
     return $this->_memcached->delete($id);
 }
开发者ID:endelwar,项目名称:doctrine1-addons,代码行数:14,代码来源:Memcached.php

示例15: delete

 /**
  * Delete data tied to a key on the cache server.
  *
  * @param string $key Key we can use to retrieve the data.
  *
  * @return bool True if deleted, false if not.
  * @access public
  */
 public function delete($key)
 {
     if ($this->connected === true && $this->ping() === true) {
         return (bool) $this->server->delete($key);
     }
     return false;
 }
开发者ID:sebst3r,项目名称:nZEDb,代码行数:15,代码来源:Cache.php


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