예제 #1
0
 public function testMultiSetAndGetTtl()
 {
     $data = ['key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'];
     $keys = array_keys($data);
     $this->assertEquals(3, $this->cache->mset($data, 10));
     $this->assertEquals($data, $this->cache->mget($keys));
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function mset(array $data, $ttl = 0)
 {
     $result = $this->cache->mset($data, $ttl);
     if ($result) {
         foreach ($data as $key => $value) {
             $this->hot[$key] = $value;
         }
     }
     return $result;
 }