fsth/redis-client

v0.1.7 2017-11-21 08:43 UTC

This package is auto-updated.

Last update: 2021-10-14 14:45:42 UTC


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');