fsth / redis-client
redis client.
Installs: 250
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/fsth/redis-client
Requires
- psr/log: >=1.0.0
README
a redis contains reconnect
usage
$this->client = new Client($this->host, $this->port);
$this->proxy = new Proxy($this->client);
$this->proxy->setLogger(new FakeLogger());
$this->proxy->set('hello', 'world');
$this->assertEquals($this->proxy->get('hello'), 'world');
$this->proxy->del('hello');
$this->assertEmpty($this->proxy->get('hello'));
$error = "";
$this->proxy->disconnect();
try {
$this->proxy->set('hello', 'world');
} catch (\Exception $e) {
$error = $e->getMessage();
}
$this->assertEmpty($error);
$this->client->set('hello', 'world');
$this->assertEquals($this->proxy->get('hello'), 'world');