src/Leevel/Router/Console/Cache.php
public function handle(IApp $app, RouterProvider $routerProvider): void
    {
        $this->line('Start to cache router.');

        $data = $routerProvider->getRouters();

        $cachePath = $app->routerCachedPath();

        $this->writeCache($cachePath, $data);

        $this->info(sprintf('Router cache file %s cache successed.', $cachePath));
    }
public function handle(IApp $app, RouterProvider $routerProvider): void
    {
        $this->line('Start to cache router.');

        $data = $routerProvider->getRouters();

        $cachePath = $app->routerCachedPath();

        $this->writeCache($cachePath, $data);

        $this->info(sprintf('Router cache file %s cache successed.', $cachePath));
    }
响应命令.

@param \Leevel\Kernel\IApp           $app
@param \Leevel\Router\RouterProvider $routerProvider