public function connect()
{
if (class_exists('Redis'))
$this->_redis = new \Redis();
else {
\Yii::error("Failed to open redis DB connection ($connection)", __CLASS__);
$message = YII_DEBUG ? "Failed to open redis DB connection ($connection)" : 'Failed to open DB connection.';
throw new Exception($message);
}
}
public function set($key, $value, $ttl = 0)
{
return $this->_redis->set($key, $value, $ttl);
}
Ну это так, может пригодится когда.