Think/Cache.php
public function connect($type = '', array $options = [])
    {
        if (empty($type)) {
            $type = C('DATA_CACHE_TYPE');
        }
        $class = strpos($type, '\\') ? $type : 'Think\\Cache\\Driver\\'.ucwords(strtolower($type));
        if (class_exists($class)) {
            $cache = new $class($options);
        } else {
            throw new BaseException(L('_CACHE_TYPE_INVALID_').':'.$type);
        }

        /** @noinspection PhpUndefinedVariableInspection */
        return $cache;
    }
public function connect($type = '', array $options = [])
    {
        if (empty($type)) {
            $type = C('DATA_CACHE_TYPE');
        }
        $class = strpos($type, '\\') ? $type : 'Think\\Cache\\Driver\\'.ucwords(strtolower($type));
        if (class_exists($class)) {
            $cache = new $class($options);
        } else {
            throw new BaseException(L('_CACHE_TYPE_INVALID_').':'.$type);
        }

        /** @noinspection PhpUndefinedVariableInspection */
        return $cache;
    }
连接缓存

@param string $type 缓存类型
@param array $options 配置数组
@return object
@throws BaseException