Ejemplo n.º 1
0
 public function testIncrement()
 {
     $reply = $this->hash->increment('a');
     $this->assertEquals(1, $reply);
     $reply = $this->hash->increment('a');
     $this->assertEquals(2, $reply);
     $reply = $this->hash->increment('a', 8);
     $this->assertEquals(10, $reply);
     $reply = $this->hash->get('a');
     $this->assertEquals(10, $reply);
 }
Ejemplo n.º 2
0
 public function hincrby($hashName, $field, $count = 1)
 {
     $key = new \Rediska_Key_Hash($hashName);
     try {
         $key->increment($field, $count);
     } catch (\Rediska_Exception $e) {
         throw new \VisitCounter\Exception\RedisException($e->getMessage(), 0, $e);
     }
     return true;
 }