Closed skeam-tj closed 11 months ago
请参考文档 https://www.workerman.net/doc/webman/db/tutorial.html 安装 illuminate/database
已经安装了,这个问题是在使用 casbin/webman-permission
这个组件时,开启了cache才报错,报错代码文件位置:
vendor\casbin\webman-permission\src\Model\LaravelRuleModel.php【line: 90】
return $this->store->remember($this->config('cache.key'), $this->config('cache.ttl'), $get);
上面那个 $this->store 没有被初始化
Laravel 的ORM 我不怎么使用,欢迎提交PR
请参考文档 https://www.workerman.net/doc/webman/db/tutorial.html 安装 illuminate/database
已经安装了,这个问题是在使用
casbin/webman-permission
这个组件时,开启了cache才报错,报错代码文件位置: vendor\casbin\webman-permission\src\Model\LaravelRuleModel.php【line: 90】return $this->store->remember($this->config('cache.key'), $this->config('cache.ttl'), $get);
上面那个 $this->store 没有被初始化
去掉了ORM Cache,目前与TP一样了。
Error: Typed property Casbin\WebmanPermission\Model\LaravelRuleModel::$store must not be accessed before initialization in D:\www\backend2\vendor\casbin\webman-permission\src\Model\LaravelRuleModel.php:90 Stack trace:
0 D:\www\backend2\vendor\casbin\webman-permission\src\Adapter\LaravelDatabaseAdapter.php(99): Casbin\WebmanPermission\Model\LaravelRuleModel->getAllFromCache()
1 D:\www\backend2\vendor\casbin\casbin\src\CoreEnforcer.php(363): Casbin\WebmanPermission\Adapter\LaravelDatabaseAdapter->loadPolicy()
2 D:\www\backend2\vendor\casbin\casbin\src\CoreEnforcer.php(223): Casbin\CoreEnforcer->loadPolicy()
3 D:\www\backend2\vendor\casbin\casbin\src\CoreEnforcer.php(156): Casbin\CoreEnforcer->initWithModelAndAdapter()
4 D:\www\backend2\vendor\casbin\webman-permission\src\Permission.php(73): Casbin\CoreEnforcer->__construct()
5 D:\www\backend2\support\bootstrap.php(109): Casbin\WebmanPermission\Permission::start()
6 D:\www\backend2\vendor\workerman\webman-framework\src\support\App.php(97): require_once('...')
7 D:\www\backend2\vendor\workerman\workerman\Worker.php(2454): support\App::support{closure}()
8 D:\www\backend2\vendor\workerman\workerman\Worker.php(1453): Workerman\Worker->run()
9 D:\www\backend2\vendor\workerman\workerman\Worker.php(1396): Workerman\Worker::forkWorkersForWindows()
10 D:\www\backend2\vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers()
11 D:\www\backend2\vendor\workerman\webman-framework\src\support\App.php(124): Workerman\Worker::runAll()
12 D:\www\backend2\start.php(4): support\App::run()