webman1.4 新建项目完全关闭默认路由后报错

xiongxiong

环境php8.0 在windows下跟linux中都是这样
在route.php
Route::any('/test', function ($request) {
return response('test');
});
Route::get('/', [\app\controller\Index::class,'index']);

Route::fallback(function () {
return json(['code' => 404, 'msg' => '404 not found']);
});

Route::disableDefaultRoute();

控制台路由报错
Route set to / is not callable
Route set to / is not callable
Route set to / is not callable
Route set to / is not callable
Route set to / is not callable

743 3 0
3个回答

liziyu

关于webman 1.4,1.4会覆盖 support/helper.php,升级前请先备份。建议先将webman 1.4试水一些非关键项目。重要项目等1-2个月后再上1.4。

是不是因为这个?猜的!

  • xiongxiong 2022-08-15

    helper.php就只是一些辅助函数吧 应该是路由改了东西 没咋看源码

  • yzh52521 2022-08-15

    应该是改路由源码了,升级后我也报错,退回上一版本正常 php8.0

mon

用的PHP8.2?

PHP8.2弃用了部分对象的调用方式,如[$class, $method]这类callable类型的

箜篌

composer require workerman/webman-framework ^v1.4.2
更新到1.4.2就好了

年代过于久远,无法发表回答
🔝