根據(jù)http://wtbis.cn/doc/webman/db/redis.html 安裝redis.
composer require -W webman/redis illuminate/events
安裝完成后,發(fā)現(xiàn)
support目錄沒有 Redis.php這個文件 。
導(dǎo)致 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
webman2
有bug 多看文檔,http://wtbis.cn/doc/webman/db/redis.html
簡單講就是:webman 2版本,需要安裝一個 包
composer require -W webman/redis illuminate/events