YiiRedis icon indicating copy to clipboard operation
YiiRedis copied to clipboard

ARadisList getCount()

Open modernx opened this issue 12 years ago • 2 comments

public function getCount() {
    if ($this->_count === null) {
        if ($this->name === null) {
            throw new CException(get_class($this)." requires a name!");
        }
        $this->_count = (int) $this->getConnection()->getClient()->lSize($this->name);
    }
    return $this->_count;
}

lSize does not work

but work this: $rconn = Yii::app()->redis->getClient(); $llen_f = $rconn->llen($redis_key);

modernx avatar Sep 19 '12 15:09 modernx

Hey, which version of phpredis are you using?

phpnode avatar Sep 19 '12 19:09 phpnode

v.2.2.2

getCount() string $this->_count = $this->getConnection()->getClient()->lSize($this->name); return: Redis Object ( [socket] => Resource id #17 )

modernx avatar Sep 20 '12 08:09 modernx