当前位置: 首页>>代码示例>>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;未经允许,请勿转载。