/** * 获得 Redis 连接 * * @return Redis */ public static function getConnection() { if (self::$_connection === null && CACHE_STATUS === true) { $redis = new Redis(); $redis->connect(REDIS_CONNECT_ADD, REDIS_CONNECT_PORT); self::$_connection = $redis; } return self::$_connection; }