__DIR__ . '/src/Modules', 'routes_file' => 'routes.php' ]); $router = new Router($config); // Load routes from a central routes file if it exists, or provide a way to load them // For this CLI tool, we might need a way to bootstrap the application's router. // Usually, this would be part of a framework. For Atlas as a library, we provide // the tool that can be integrated. // In a real scenario, the user would point this tool to their router bootstrap file. // For demonstration, let's assume we have a `bootstrap/router.php` that returns the Router. $bootstrapFile = getcwd() . '/bootstrap/router.php'; if (file_exists($bootstrapFile)) { $router = require $bootstrapFile; } switch ($command) { case 'route:list': (new ListRoutesCommand())->execute($router, $argv); break; case 'route:test': (new TestRouteCommand())->execute($router, $argv); break; default: echo "Atlas Routing CLI" . PHP_EOL; echo "Usage:" . PHP_EOL; echo " php atlas route:list [--json]" . PHP_EOL; echo " php atlas route:test [--verbose]" . PHP_EOL; break; }