使用webman2 安装了redis, support目录没有 Redis.php这个文件

ccbu7758520

问题描述

根据https://www.workerman.net/doc/webman/db/redis.html 安装redis.
composer require -W webman/redis illuminate/events
安装完成后,发现
support目录没有 Redis.php这个文件 。

导致 use support\Redis; 会报错。怎么搞。

程序代码

<?php
namespace app\index\controller;
use support\Request;
use support\Redis;
class Test
{
    public function index(Request $request)
    {
        $key = 'test_key';
        Redis::set($key, rand());
        return response(Redis::get($key));
    }

}

报错信息

Error: Class "support\Redis" not found in

操作系统及workerman/webman等框架组件具体版本

webman2

102 2 0
2个回答

北月妖王
  • ccbu7758520 5天前

    牛,可以用了,我翻了github好久,都没找到这个文件。

efnic

有bug 多看文档,https://www.workerman.net/doc/webman/db/redis.html

简单讲就是:webman 2版本,需要安装一个 包

composer require -W webman/redis illuminate/events

  • 暂无评论
🔝