-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Allow configuring taggable cache pools #26934
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8f0b6bd
to
88f22a2
Compare
What is your opinion on making this default? |
Tags involve extra round-trips so this cannot be the default IMHO. |
Wooooo! So much easier than currently :). It looks like And, is there a way that a user could add tagging to the Update: About the taggable |
A service id can also be given here, where tags will be stored. This would then look like:
not needed as you spotted in #26929: just type-hint |
Ah, of course! I think we should keep |
Moving to 4.2. |
$pools[$id] = new Reference($id); | ||
foreach ($clearer->getArgument(0) as $name => $ref) { | ||
if ($container->hasDefinition($id = (string) $ref)) { | ||
$pools[$name] = new Reference($id); |
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 found this change a bit hard to read as $id
is used in both loops. Can we solve that by renaming one of them?
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.
updated
$definition = new ChildDefinition($pool['adapter']); | ||
|
||
if ($pool['tags']) { | ||
if ($config['pools'][$pool['tags']]['tags'] ?? false) { |
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.
Do we really want to fail silently if you misconfigure a cache pool service for the tags by having a typo there?
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 don't think we can do otherwise: you should be allowed to reference a service you created manually.
For the "typo" case, this will create a Reference to a missing service, so you'll still get an error in the end.
88f22a2
to
d0ba134
Compare
e6be2bf
to
ca4ccb7
Compare
vote pending @symfony/deciders |
ca4ccb7
to
7651c60
Compare
7651c60
to
896be4c
Compare
…ls (nicolas-grekas) This PR was merged into the 4.2-dev branch. Discussion ---------- [FrameworkBundle] Allow configuring taggable cache pools | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25903 | License | MIT | Doc PR | symfony/symfony-docs#9652 This PR adds a new configuration option for cache pools: ```yaml framework: cache: pools: app.taggable_pool: tags: true app.taggable_pool_with_separate_store_for_tags: tags: app.my_pool_for_tags ``` Commits ------- 896be4c [FrameworkBundle] Allow configuring taggable cache pools
This PR adds a new configuration option for cache pools: