Make the always_expire_wfd_meta_resources
config setting work regardless of kernel.debug
mode
#50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
always_expire_wfd_meta_resources
config setting can be used to makeWfdMetaResource
instances always expire immediately. It is supposed to be set in Symfony environments liketest
(e. g. in aconfig_test.yml
file or awhen@test
section).However, until now, it works correctly only for
kernel.debug = true
.This is because it used a special
CacheBustingResourceChecker
that would be used by the "inner" (regular)ConfigCache
instance only. That ResourceChecker would invalidate the cache when an instance of aWfdMetaResource
is found.The
ConfigCache
, however, contains a shortcut to never validate the cache in the first place whenkernel.debug
is disabled.Thus, we need to move this behavior to the
WfdMetaConfigCache
, which will run its check also in non-debug mode. There, we want to consider the setting only in the case that there are actuallyWfdMetaResource
s associated with the cache in question.Being able to disable
kernel.debug
mode for tests execution can provide a significant speed-up in environments where you don't actually modify code between test runs, i. e. a CI pipeline.