當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。