console命令行获取所有路由是空数组Route::getRoutes()

Tinywan
protected function execute(InputInterface $input, OutputInterface $output)
{
    $output->writeln('Route列表:');
    $routeList = Route::getRoutes();
    var_dump($routeList);
}

1451 3 0
3个回答

walkor

webman/console 支持了打印路由列表功能。
./webman route:list

  • ExecPHP 2022-01-10

    and where to get webman/console? I don't have the ./webman file

  • walkor 2022-01-10

    Run command composer require webman/console.
    This command requires workerman/webman>=1.2.2 and workerman/webman-framework>=1.2.1

  • ExecPHP 2022-01-10

    Thanks!

Tinywan

使用不了,报错 There are no commands defined in the "group" namespace.

截图

使用 ./webman route:list

截图

  • walkor 2022-01-10

    是不是本地项目和线上哪里不一致?
    创建新项目composer create-project workerman/webman 然后试下

  • Tinywan 2022-01-10

    我本地代码和weban官方的更新成完全一致了,还是不行,不知道怎么回事?哈哈

  • walkor 2022-01-10

    我知道怎么回事了,等下我修复下

  • Tinywan 2022-01-10

    好的

  • walkor 2022-01-10

    好了,更新到 workerman/webman v1.2.2 workerman/webman-framework v1.2.1

  • Tinywan 2022-01-10

    谢谢,可以啦!

Tinywan

可以啦

截图

  • 暂无评论
年代过于久远,无法发表回答
🔝