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


PHP Redis::lLen方法代码示例

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


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

示例1: it_can_llen

 public function it_can_llen()
 {
     $this->redis->lLen('test')->shouldBeCalled()->willReturn(1);
     $this->lLen('test')->shouldReturn(1);
     $this->redis->lLen('test')->willThrow(new \RedisException());
     $this->shouldThrow(DriverException::class)->during('lLen', ['test']);
 }
开发者ID:mgdigital,项目名称:busque,代码行数:7,代码来源:PHPRedisAdapterSpec.php

示例2: length

 public static function length($key)
 {
     $redis = self::instance();
     if ($redis) {
         self::$redis->lLen($key);
     }
 }
开发者ID:aoyel,项目名称:pinst,代码行数:7,代码来源:RedisQuery.php

示例3: lLen

 /**
  * @param string $key
  * @return int
  * @throws CM_Exception_Invalid
  */
 public function lLen($key)
 {
     $length = $this->_redis->lLen($key);
     if (false === $length) {
         throw new CM_Exception_Invalid('Key `' . $key . '` does not contain a list');
     }
     return $length;
 }
开发者ID:aladin1394,项目名称:CM,代码行数:13,代码来源:Client.php

示例4: testDifferentTypeHash

 public function testDifferentTypeHash()
 {
     $key = '{hash}hash';
     $dkey = '{hash}hash';
     $this->redis->del($key);
     $this->assertEquals(1, $this->redis->hSet($key, 'key', 'value'));
     // string I/F
     $this->assertEquals(FALSE, $this->redis->get($key));
     $this->assertEquals(FALSE, $this->redis->getset($key, 'value2'));
     $this->assertEquals(FALSE, $this->redis->append($key, 'append'));
     $this->assertEquals(FALSE, $this->redis->getRange($key, 0, 8));
     $this->assertEquals(array(FALSE), $this->redis->mget(array($key)));
     $this->assertEquals(FALSE, $this->redis->incr($key));
     $this->assertEquals(FALSE, $this->redis->incrBy($key, 1));
     $this->assertEquals(FALSE, $this->redis->decr($key));
     $this->assertEquals(FALSE, $this->redis->decrBy($key, 1));
     // lists I/F
     $this->assertEquals(FALSE, $this->redis->rPush($key, 'lvalue'));
     $this->assertEquals(FALSE, $this->redis->lPush($key, 'lvalue'));
     $this->assertEquals(FALSE, $this->redis->lLen($key));
     $this->assertEquals(FALSE, $this->redis->lPop($key));
     $this->assertEquals(FALSE, $this->redis->lrange($key, 0, -1));
     $this->assertEquals(FALSE, $this->redis->lTrim($key, 0, 1));
     $this->assertEquals(FALSE, $this->redis->lGet($key, 0));
     $this->assertEquals(FALSE, $this->redis->lSet($key, 0, "newValue"));
     $this->assertEquals(FALSE, $this->redis->lrem($key, 'lvalue', 1));
     $this->assertEquals(FALSE, $this->redis->lPop($key));
     $this->assertEquals(FALSE, $this->redis->rPop($key));
     $this->assertEquals(FALSE, $this->redis->rPoplPush($key, $dkey . 'lkey1'));
     // sets I/F
     $this->assertEquals(FALSE, $this->redis->sAdd($key, 'sValue1'));
     $this->assertEquals(FALSE, $this->redis->srem($key, 'sValue1'));
     $this->assertEquals(FALSE, $this->redis->sPop($key));
     $this->assertEquals(FALSE, $this->redis->sMove($key, $dkey . 'skey1', 'sValue1'));
     $this->assertEquals(FALSE, $this->redis->scard($key));
     $this->assertEquals(FALSE, $this->redis->sismember($key, 'sValue1'));
     $this->assertEquals(FALSE, $this->redis->sInter($key, $dkey . 'skey2'));
     $this->assertEquals(FALSE, $this->redis->sUnion($key, $dkey . 'skey4'));
     $this->assertEquals(FALSE, $this->redis->sDiff($key, $dkey . 'skey7'));
     $this->assertEquals(FALSE, $this->redis->sMembers($key));
     $this->assertEquals(FALSE, $this->redis->sRandMember($key));
     // sorted sets I/F
     $this->assertEquals(FALSE, $this->redis->zAdd($key, 1, 'zValue1'));
     $this->assertEquals(FALSE, $this->redis->zRem($key, 'zValue1'));
     $this->assertEquals(FALSE, $this->redis->zIncrBy($key, 1, 'zValue1'));
     $this->assertEquals(FALSE, $this->redis->zRank($key, 'zValue1'));
     $this->assertEquals(FALSE, $this->redis->zRevRank($key, 'zValue1'));
     $this->assertEquals(FALSE, $this->redis->zRange($key, 0, -1));
     $this->assertEquals(FALSE, $this->redis->zRevRange($key, 0, -1));
     $this->assertEquals(FALSE, $this->redis->zRangeByScore($key, 1, 2));
     $this->assertEquals(FALSE, $this->redis->zCount($key, 0, -1));
     $this->assertEquals(FALSE, $this->redis->zCard($key));
     $this->assertEquals(FALSE, $this->redis->zScore($key, 'zValue1'));
     $this->assertEquals(FALSE, $this->redis->zRemRangeByRank($key, 1, 2));
     $this->assertEquals(FALSE, $this->redis->zRemRangeByScore($key, 1, 2));
 }
开发者ID:Jerry-Shaw,项目名称:phpredis,代码行数:56,代码来源:RedisTest.php

示例5: getQueueSize

 /**
  * return queue length
  * @return int the queue length
  */
 public function getQueueSize()
 {
     return $this->_redis->lLen($this->_queueStructName);
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:8,代码来源:Redis.php

示例6: getRunningSize

 public function getRunningSize()
 {
     return (int) $this->redis->lLen($this->getTaskRunKey());
 }
开发者ID:drealecs,项目名称:thread-worker,代码行数:4,代码来源:RedisQueue.php

示例7: llen

 /**
  * lLen a raw value
  *
  * @param	string	$key	Cache ID
  * @return	mixed	Value on success or FALSE on failure
  */
 public function llen($key)
 {
     return $this->_redis->lLen($key);
 }
开发者ID:asmenglei,项目名称:lanxiao,代码行数:10,代码来源:Cache_redis.php

示例8: count

 /**
  * @inheritdoc
  */
 public function count()
 {
     $this->checkClientConnection();
     return $this->client->lLen("queue:{$this->name}:messages");
 }
开发者ID:flowpack,项目名称:jobqueue-redis,代码行数:8,代码来源:RedisQueue.php

示例9: length

 /**
  * 获取Redis队列长度
  *
  * @param string $queue Redis队列名
  *
  * @return int
  */
 public function length($queue)
 {
     return $this->redis->lLen($queue);
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:11,代码来源:RedisCount.php

示例10: Redis

<?php

$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
// 加上时间戳存入队列
$now_time = date("Y-m-d H:i:s");
$interface_info = array('user_uuid' => '123456df', 'comment' => 'rwesdf');
$r_len = $redis->lLen("call_log");
//    for($i = 0; $i < $r_len; $i++){
//        $redis->lPop("call_log");
//    }
$interface_info = json_encode($interface_info);
for ($i = 1; $i <= 10000; $i++) {
    $redis->rPush("call_log", $interface_info);
}
开发者ID:huangbinzd,项目名称:yaf_private_test,代码行数:15,代码来源:redis.php


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