コード例 #1
0
ファイル: HashTest.php プロジェクト: r-kovalenko/Rediska
 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);
 }
コード例 #2
0
 public function hmget($hashName, array $fields)
 {
     $key = new \Rediska_Key_Hash($hashName);
     try {
         $result = $key->get($fields);
     } catch (\Rediska_Exception $e) {
         throw new \VisitCounter\Exception\RedisException($e->getMessage(), 0, $e);
     }
     return array_combine($fields, $result);
 }