Jenner\SimpleFork\Cache\RedisCache::set PHP Method

set() public method

set var
public set ( $key, null $value ) : boolean
$key
$value null
return boolean
    public function set($key, $value)
    {
        return $this->redis->hSet($this->prefix, $key, $value);
    }

Usage Example

 public function testAll()
 {
     if (!extension_loaded("Redis")) {
         $this->markTestSkipped("Redis extension is not loaded");
     }
     $this->cache = new Jenner\SimpleFork\Cache\RedisCache();
     $this->cache->set('cache', 'test');
     $this->assertTrue($this->cache->has('cache'));
     $this->assertEquals($this->cache->get('cache'), 'test');
     $this->assertTrue($this->cache->delete('cache'));
     $this->assertNull($this->cache->get('cache'));
     $this->cache->close();
 }