Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DI][Router][DX] Invalidate routing cache when container parameters changed#21767
New issue
Have a question about this project? 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[DI][Router][DX] Invalidate routing cache when container parameters changed#21767
Uh oh!
There was an error while loading.Please reload this page.
Conversation
weaverryan commentedMar 4, 2017
👍 Nice work! |
| private $parameters; | ||
| /** | ||
| * @param array $parameters The container parameters values to track |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I would remove "values" here.
| return false; | ||
| } | ||
| } | ||
| } catch (ParameterNotFoundException $exception) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why not callinghasParameter() instead?
ogizanagi commentedMar 5, 2017
Thanks for the review.@xabbuh's comments addressed. |
xabbuh commentedMar 5, 2017
👍 |
fabpot commentedMar 5, 2017
Thank you@ogizanagi. |
…er parameters changed (ogizanagi)This PR was merged into the 3.3-dev branch.Discussion----------[DI][Router][DX] Invalidate routing cache when container parameters changed| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#21426| License | MIT| Doc PR | N/ASupersedes#21443 but only for master.Indeed, this implementation uses a new feature: a `ContainerParametersResource` which compares cached containers parameters (collected at some point, here by the `Router`) with current ones in the container.On the contrary of the previous PR targeting 2.7, this will only invalidate routing cache when parameters actually used in the routes changed and will avoid always rebuilding the routing cache when the container is rebuilt, just to catch the edge case of someone modifying a parameter.Commits-------fad4d9e [DI][Router][DX] Invalidate routing cache when container parameters changed
Uh oh!
There was an error while loading.Please reload this page.
Supersedes#21443 but only for master.
Indeed, this implementation uses a new feature: a
ContainerParametersResourcewhich compares cached containers parameters (collected at some point, here by theRouter) with current ones in the container.On the contrary of the previous PR targeting 2.7, this will only invalidate routing cache when parameters actually used in the routes changed and will avoid always rebuilding the routing cache when the container is rebuilt, just to catch the edge case of someone modifying a parameter.