imlinfly / webman-annotation

Webman plugin linfly/annotation
MIT License
10 stars 0 forks source link

同时使用控制器注解和注解路由 导致bug #9

Closed Jzh-thub closed 1 year ago

Jzh-thub commented 1 year ago

会产生2个路由 一个 prefix+path 一个path的路由

image
imlinfly commented 1 year ago

控制器输出的内容是从哪里打印的呢

Jzh-thub commented 1 year ago

$rows = []; foreach (\Webman\Route::getRoutes() as $route) { foreach ($route->getMethods() as $method) { $cb = $route->getCallback(); $cb = $cb instanceof \Closure ? 'Closure' : (is_array($cb) ? json_encode($cb) : var_export($cb, 1)); $rows[] = [$route->getPath(), $method, $cb, json_encode($route->getMiddleware() ?: null), $route->getName()]; } }

    print_r($rows);
Jzh-thub commented 1 year ago

控制访问后打印的

imlinfly commented 1 year ago

麻烦使用composer info命令看一下linfly/annotation包的版本号,我这边刚拉取的webman框架使用的linfly/annotation:1.0.11版本没有复现这个问题。

Jzh-thub commented 1 year ago

好像是我这边 重复加载导致的,已排查了。