Exemplo n.º 1
0
 public function testHashGet()
 {
     $client = new Client(array('host' => 'localhost'));
     $connection = $client->createConnection();
     $this->assertTrue($connection);
     $client->hSetNx('testkey', 'testhash', 1);
     $result = $client->hGet('testkey', 'testhash');
     $this->assertEquals(1, $result);
     $client->del('testkey');
 }
Exemplo n.º 2
0
 /**
  * Loads data for the given key.
  *
  * @param string $key The store key
  *
  * @return string The data associated with the key
  */
 private function load($key)
 {
     $this->client->createConnection();
     $values = $this->client->get($key);
     $this->client->close();
     return $values;
 }
Exemplo n.º 3
0
 protected function cleanKeys()
 {
     $client = new Client(array('host' => 'localhost'));
     $client->createConnection();
     $client->flushAll();
 }