缓存机制

目录

System/libraries/Cache

自行封装

public static function getRs()
{
    $config = CI::config('redis');
    $redis = new \Redis();
    try {
        if ($redis->connect($config['host'], $config['port'])) {
            $redis->select((int)$config['db']);
        }
    } catch (\Exception $e) {
        return false;
    }
    return $redis;
}

Last updated