-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Too many Routes ? #16343
New issue
Have a question about this pro 8000 ject? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please provide a fork of symfony-standard that reproduces the problem |
As asked : https://github.com/AntoineLemaire/symfony-standard/commits/2.8 (Don't know why, but this time, route |
Just checked this a bit, and it seems weird to say the least. Check #16386 |
Known PHP issue for PHP5.6+ but it is only fixed in PHP7+. [2015-03-23 17:51 UTC] bwoebi@php.net |
As a potential issue, can the cached urlGenerator retrieve the routes using php5.5 generators instead of saving all datas in an array? Maybe it would save some memory? If it's not fixed in php5.6 maybe it could be a nice idea 😕 ? |
I can reproduce the bug mentioned by @JHGitty , which is probably the cause for your issue. So basically you can't have arrays with more than 2^15 elements in PHP 5.6. That seems like a really critical bug to me because I think 2^15 is very small in 2015... |
Well they marked it as won't fix. So the author has two choices. downgrade to 5.5, or upgrade to upcoming 7.0. IMO, it's rare for one to have that many routes. |
@mvrhov Yep, I'm waiting for 7.0 and I'll see with it. |
@AntoineLemaire That huge number of routes does seem excessive, I'm sure that in 99.9% of situations, they can be significantly reduced.
|
@AntoineLemaire I've updated my fix (#16386) for this so it has a slightly different behaviour in php 5.6 in the case you have a large number of routes. |
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #16386). Discussion ---------- Bug #16343 [Router] Too many Routes ? | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16343 | License | MIT | Doc PR | N/A Seems there is an issue when you have more than 7265 routes declared, The routes are generated into the cached appDevUrlGenerator.php but php only loads the last 7265 elements of the array. Commits ------- 0113ac3 Bug #16343 [Router] Too many Routes ?
* 2.3: Always enable clock-mock for HttpFoundation [ClassLoader] Fix parsing namespace when token_get_all() is missing Bug #16343 [Router] Too many Routes ?
* 2.7: Always enable clock-mock for HttpFoundation [ClassLoader] Fix parsing namespace when token_get_all() is missing Bug #16343 [Router] Too many Routes ? [Debug] Ensure class declarations are loaded only once
* 2.8: Always enable clock-mock for HttpFoundation [ClassLoader] Fix parsing namespace when token_get_all() is missing Bug #16343 [Router] Too many Routes ? Fixes the stack traces of the deprecation logs fix unused variable warning [Translation][Form] Do not translate form labels and placeholders when 'translation_domain' is false add composer exclude-from-classmap for new 2.8 components [Yaml] sync changelog and upgrade files [Debug] Ensure class declarations are loaded only once Minor design tweaks for the Logs and Doctrine profiler panels Conflicts: UPGRADE-2.8.md
* 2.8: Always enable clock-mock for HttpFoundation [ClassLoader] Fix parsing namespace when token_get_all() is missing Bug symfony#16343 [Router] Too many Routes ? Fixes the stack traces of the deprecation logs fix unused variable warning [Translation][Form] Do not translate form labels and placeholders when 'translation_domain' is false add composer exclude-from-classmap for new 2.8 components [Yaml] sync changelog and upgrade files [Debug] Ensure class declarations are loaded only once Minor design tweaks for the Logs and Doctrine profiler panels Conflicts: UPGRADE-2.8.md
Is there a limit with the number of routes we can create ?
My application is using JMSI18nRoutingBundle, and we have more than 30 locales.
JMS create in
app/cache/prod/appProdUrlGenerator.php
all routes for each locales in$declaredRoutes
I opened a ticket an issue on JMSI18nRoutingBundle (link), but it seems the issue is the same in symfony without JMSI18nRoutingBundle.
I just try to create a basic project, with 20 controllers, and foreach of them, on function with 2000 routes.
When number of routes approaches 32 760,
echo $this->generateUrl('homepage1');
is failing :The text was updated successfully, but these errors were encountered: