示例#1
0
 /**
  * @param array $keys
  *
  * @return array
  */
 public function getMulti(array $keys)
 {
     if (count($keys) === 0) {
         return $keys;
     }
     $transformedKeys = [];
     foreach ($keys as $key) {
         $transformedKeys[] = $this->getKeyName($key);
     }
     $values = array_combine($transformedKeys, $this->client->mget($transformedKeys));
     $this->addMultiReadAccessStats($keys);
     return $values;
 }
示例#2
0
文件: PredisTest.php 项目: gmo/cache
 /**
  * @group redis-strings
  */
 public function testMultipleGet()
 {
     $this->client->mset(array('foo' => 'bar', 'hello' => 'world'));
     $this->assertEquals(array('bar', 'world'), $this->client->mget('foo', 'hello'));
 }