webman自动路由插件有一个bug

ontheway
    // 根据文件路径计算uri
    $uri_path = str_replace(['/controller/', '/Controller/'], '/',       substr(substr($file_path, strlen(app_path())), 0, - (4 + $suffix_length)));

需要把$uri_path转化为小写

    // 根据文件路径计算uri
    $uri_path = str_replace(['/controller/', '/Controller/'], '/',       substr(substr($file_path, strlen(app_path())), 0, - (4 + $suffix_length)));
    $uri_path = strtolower($uri_path);

要不然下面这句根本执行不到:

            if (substr($uri_path, -6) === '/index') {
                $route(substr($uri_path, 0, -6), [$class_name, $action]);
            }

还有一个问题是,不知道算不算问题,就是没有注册/路由

928 1 0
1个回答

walkor

欢迎直接发pr

  • ontheway 2022-07-21

    明天来提,随便实现default_app

  • ontheway 2022-07-22

    我想问一下,为什么config\plugin\webman\auto-route\route.php这个文件会执行两次

  • walkor 2022-07-22

    每个进程执行一次,2个进程就执行2次

  • ontheway 2022-07-22

    哦,明白了

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