當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Client::del方法代碼示例

本文整理匯總了PHP中Predis\Client::del方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::del方法的具體用法?PHP Client::del怎麽用?PHP Client::del使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Predis\Client的用法示例。


在下文中一共展示了Client::del方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: del

 /**
  * @param $name
  */
 public function del($name)
 {
     if (isset($this->buffer[$name])) {
         unset($this->buffer[$name]);
     }
     $this->client->del($name);
 }
開發者ID:jced-artem,項目名稱:test_game,代碼行數:10,代碼來源:Cache.php

示例2: flushIndex

 public function flushIndex()
 {
     if ($this->indexing) {
         $this->store->del("{$this->prefix}::index");
     }
     return parent::flushIndex();
 }
開發者ID:simon-downes,項目名稱:spf,代碼行數:7,代碼來源:Redis.php

示例3: delete

 /**
  * Remove values from cache
  *
  * @param  array $keys list of keys to delete
  *
  * @return boolean true on success, false on failure
  */
 protected function delete(array $keys)
 {
     foreach ($keys as $k) {
         $k = sha1($k);
         $this->redis->del($k);
     }
     return true;
 }
開發者ID:noikiy,項目名稱:Laravel.Smarty,代碼行數:15,代碼來源:Redis.php

示例4: deleteItems

 /**
  * @param array $keys
  * @return bool
  */
 public function deleteItems(array $keys)
 {
     $return = $this->client->del($keys);
     if ($return > 0) {
         return true;
     }
     return false;
 }
開發者ID:splitio,項目名稱:php-client,代碼行數:12,代碼來源:PRedis.php

示例5: remove

 /**
  * @param $key
  * @throws UnavailableException
  */
 public function remove($key)
 {
     try {
         $this->client->del([$key]);
     } catch (ServerException $ex) {
         throw new UnavailableException($ex->getMessage());
     }
 }
開發者ID:RepoMon,項目名稱:tokens,代碼行數:12,代碼來源:Redis.php

示例6: popItem

 /**
  * @param $queueName
  * @return QueueItemInterface
  */
 public function popItem($queueName)
 {
     $this->getKeys($queueName, true);
     $key = array_pop($this->keys);
     $itemRaw = $this->redis->get($key);
     $item = unserialize($itemRaw);
     $this->redis->del($key);
     return $item;
 }
開發者ID:akentner,項目名稱:incoming-ftp,代碼行數:13,代碼來源:RedisQueue.php

示例7: count

 /**
  * {@inheritDoc}
  */
 public function count(array $sources)
 {
     call_user_func_array([$this->redis, 'zunionstore'], array_merge([$key = sha1(microtime()), count($sources)], array_map(function ($source) {
         return "aggregator:sources:{$source}";
     }, $sources)));
     $count = $this->redis->zcard($key);
     $this->redis->del($key);
     return $count;
 }
開發者ID:nonconforme,項目名稱:aggregator,代碼行數:12,代碼來源:RedisAggregator.php

示例8: delete

 /**
  * {@inheritdoc}
  */
 protected function delete(array $keys)
 {
     try {
         $this->client->del($keys);
     } catch (\Predis\Response\ServerException $e) {
         return false;
     }
     return true;
 }
開發者ID:autocom,項目名稱:smarty-redis,代碼行數:12,代碼來源:CacheResource.php

示例9: lookupKeyInRedisDatabase

 /**
  * Checks if the activation key is present in the redis database.
  *
  * @param string $activationKey
  *
  * @return bool
  */
 private function lookupKeyInRedisDatabase($activationKey)
 {
     $persistentKey = $this->generateRedisKeyByApprovalKey($activationKey);
     $exists = $this->redis->exists($persistentKey);
     // the key is not needed anymore because the approval validation will be triggered once only.
     if ($exists) {
         $this->redis->del($persistentKey);
     }
     return $exists;
 }
開發者ID:thomasmodeneis,項目名稱:Sententiaregum,代碼行數:17,代碼來源:PendingActivationsCluster.php

示例10: recheck

 /**
  * @inheritdoc
  */
 public function recheck($event)
 {
     $value = $this->client->get($event);
     if (!$value) {
         return;
     }
     foreach ($this->listeners[$event] ?? [] as $listener) {
         $listener($value);
     }
     $this->client->del([$event]);
 }
開發者ID:adamnicholson,項目名稱:kyew,代碼行數:14,代碼來源:RedisPubSub.php

示例11: logout

 public function logout()
 {
     $userId = $this->session->get('userId');
     $newAuthSecret = $this->getRand();
     $oldAuthSecret = $this->redisClient->get("uid:{$userId}:auth");
     $this->redisClient->set("uid:{$userId}:auth", $newAuthSecret);
     $this->redisClient->set("auth:{$newAuthSecret}", $userId);
     $this->redisClient->del("auth:{$oldAuthSecret}");
     $this->session->set('userId', null);
     $this->session->set('username', null);
 }
開發者ID:KrunoKnego,項目名稱:Symfony-Twitter-Clone,代碼行數:11,代碼來源:RedisLogout.php

示例12: removeWithName

 /**
  * @param $key
  *
  * @return int
  */
 public function removeWithName($key)
 {
     $result = 0;
     // se key ha l'asterisco, cancella tutte le chiavi che iniziano per il prefisso in $key
     if (strpos($key, '*') !== false) {
         foreach ($this->redis->keys($key) as $k) {
             $result += $this->redis->del($k);
         }
     } else {
         $result += $this->redis->del($key);
     }
     return $result;
 }
開發者ID:GruppoMeta,項目名稱:Movio,代碼行數:18,代碼來源:QueryRedis.php

示例13: clearQueue

 public function clearQueue($stub)
 {
     for ($x = 0; $x < 10; $x++) {
         $iterator = new Iterator\Keyspace($this->redisClient, $stub . "*", 200);
         $keysToDelete = [];
         foreach ($iterator as $key) {
             $keysToDelete[] = $key;
         }
         if (count($keysToDelete)) {
             $this->redisClient->del($keysToDelete);
         }
     }
 }
開發者ID:atawsports2,項目名稱:Imagick-demos,代碼行數:13,代碼來源:RedisTaskQueue.php

示例14: revokeAccess

 /**
  *
  */
 private function revokeAccess()
 {
     $accessToken = $this->redis->get(self::REDIS_ACCESS_TOKEN);
     $this->redis->del(self::REDIS_ACCESS_TOKEN);
     $this->redis->del(self::REDIS_REFRESH_TOKEN);
     $this->googleClient->revokeToken($accessToken);
 }
開發者ID:akentner,項目名稱:incoming-ftp,代碼行數:10,代碼來源:GoogleDriveCommand.php

示例15: invalidate

 /**
  * @param string $providerPrefix
  *
  * @return bool
  */
 public function invalidate($providerPrefix)
 {
     $keys = $this->client->keys($this->prefix . strtolower($providerPrefix) . '_*');
     foreach ($keys as $key) {
         $this->client->del($key);
     }
     return true;
 }
開發者ID:paul-schulleri,項目名稱:adform-client,代碼行數:13,代碼來源:RedisCache.php


注:本文中的Predis\Client::del方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。