准备使用swoole来提供laravel-admin的性能,集成的是swooletw/laravel-swoole,提升效果很明显,但是发现switch组件失效,$this->grid->resource()的值始终不改变,求解
swoole常住内存 laravel 的 singleton 基本不变 看resource方法定义如下
function resource($path = null)
{
if (!empty($path)) {
$this->resourcePath = $path;
return $this;
}
if (!empty($this->resourcePath)) {
return $this->resourcePath;
}
return app('request')->getPathInfo();
}
你可以在本地修改vendor尝试把return app('request')->getPathInfo()换成Request::capture()->getPathinfo()试试,即每次请求都重新初始化Request对象
确实是一个方向,但你这个应该说是兼容laravel-swoole
进行了这些修改https://www.jianshu.com/p/2a6ec17ba078 ,对接laravel-s,目前没发现问题.
进行了这些修改https://www.jianshu.com/p/2a6ec17ba078 ,对接laravel-s,目前没发现问题.
PHP的版本 和 Laravel Admin的版本 Swoole的版本各是多少?
感谢付出!
@leo-yi
laravel-admin版本: master分支最新代码
swoole版本: Version => 4.4.0-alpha
php版本: PHP 7.2.14
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
进行了这些修改https://www.jianshu.com/p/2a6ec17ba078 ,对接laravel-s,目前没发现问题.