symfony-cmf / Routing

Routing component building on the Symfony Routing component
Other
289 stars 70 forks source link

Symfony Route is not loaded from dumped file #262

Closed jbcr closed 3 years ago

jbcr commented 3 years ago

Environment

Symfony packages

$ composer show --latest 'symfony/*'

My projet is an Sylius 1.8 (based on symfony 4.4)

Symfony CMF packages

$ composer show --latest 'symfony-cmf/*'

versions : 2.3.3

Subject

When I have the chained router, Symfony does not load the dumped url generator file.

Steps to reproduce

Install CMF Routing, and define many YAML routing files.

In Twig template, use path('index')

Profile the query with xhprof and read the result

Expected results

Read the UrlGenerator.php file found in the cache directory.

Actual results

Load all routes from source files.

dbu commented 3 years ago

i think this issue belongs into https://github.com/symfony-cmf/routing-bundle as it must be something about the integration of cmf routing into the framework.

the cmf router-bundle hides the default router service alias unless you disable that by setting cmf_routing: replace_symfony_router: false

the chain router has the dynamic router plus the router.default service. i am not too familiar with how the dumped url generator works - is it possible that you need to add another router service in the routers_by_id configuration instead of router.default?

jbcr commented 3 years ago

Thanks, @dbu.

I have fixed the problem in my custom route provider.