Skip to content

Add command to dump all routes as yaml to opt out of this bundle#29

Merged
alexander-schranz merged 24 commits into
handcraftedinthealps:1.1from
mamazu:adding_command_to_migrate
Jun 10, 2025
Merged

Add command to dump all routes as yaml to opt out of this bundle#29
alexander-schranz merged 24 commits into
handcraftedinthealps:1.1from
mamazu:adding_command_to_migrate

Conversation

@mamazu
Copy link
Copy Markdown
Contributor

@mamazu mamazu commented Mar 21, 2025

We want to remove this plugin from the sulu core code. For that we need a way to generate the routes as a yaml file and copy it over to the project.

This PR adds a command that dumps all routes as YAML then you can copy over what you need.
If you want XML routing just use the Symfony router: bin/console debug:router --format xml
If you want php routing. Dump the yaml and convert it with the symplify/config-transformer package.

Comment thread Command/GenerateRoutes.php Outdated
Comment thread Command/GenerateRoutes.php Outdated
unset($routeData[$key]);
}
}
$routes[$name] = $routeData;
Copy link
Copy Markdown
Member

@alexander-schranz alexander-schranz Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add an option to filter out only specific routes:

 --controller="sulu_category.category_controller" # matching all start with this

or

 --name-prefix="sulu_category." # matching all start with this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done?

Comment thread Command/GenerateRoutes.php Outdated
Comment thread Command/GenerateRoutes.php Outdated
Comment thread Command/GenerateRoutes.php Outdated
Comment thread Command/GenerateRoutes.php Outdated
Comment thread Command/GenerateRoutes.php Outdated
mamazu and others added 6 commits June 10, 2025 09:27
Co-authored-by: Alexander Schranz <alexander@sulu.io>
Co-authored-by: Alexander Schranz <alexander@sulu.io>
Co-authored-by: Alexander Schranz <alexander@sulu.io>
Co-authored-by: Alexander Schranz <alexander@sulu.io>
Comment thread Command/GenerateRoutes.php Outdated
Co-authored-by: Alexander Schranz <alexander@sulu.io>
Comment thread Command/GenerateRoutes.php Outdated
Comment thread Command/GenerateRoutes.php Outdated
Comment thread Command/GenerateRoutes.php Outdated
}

if ($controllerName !== null) {
return $data['controller'] !== $controllerName;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also str_starts_with as previousy the controller service included more actions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean you can't use both filters in combination but that doesn't sound like a use-case.

Comment thread Command/GenerateRoutes.php Outdated
Comment thread Command/GenerateRoutes.php Outdated
Comment thread Command/GenerateRoutes.php Outdated
Comment thread Command/GenerateRoutes.php Outdated
Comment thread README.md Outdated
@alexander-schranz alexander-schranz changed the title Adding command to generate all routes as yaml Add command to dump all routes as yaml to opt out of this bundle Jun 10, 2025
Comment thread Command/DumpRoutes.php
@alexander-schranz alexander-schranz merged commit 998347f into handcraftedinthealps:1.1 Jun 10, 2025
10 checks passed
@mamazu mamazu deleted the adding_command_to_migrate branch June 10, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants