/** * 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; }
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'); }
protected function cleanKeys() { $client = new Client(array('host' => 'localhost')); $client->createConnection(); $client->flushAll(); }