Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedApr 15, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#25903
LicenseMIT
Doc PRsymfony/symfony-docs#9652

This PR adds a new configuration option for cache pools:

framework:cache:pools:app.taggable_pool:tags:trueapp.taggable_pool_with_separate_store_for_tags:tags:app.my_pool_for_tags

Koc and kbond reacted with hooray emoji
@ostrolucky
Copy link
Contributor

What is your opinion on making this default?

@nicolas-grekas
Copy link
MemberAuthor

Tags involve extra round-trips so this cannot be the default IMHO.

@weaverryan
Copy link
Member

weaverryan commentedApr 16, 2018
edited
Loading

Wooooo! So much easier than currently :). It looks liketags: true (the simplest config) just re-uses the same adapter for tagging. I like that. What do you think abouttaggable: true - it makes it sound a bit more like we're adding a "behavior"?

And, is there a way that a user could add tagging to theapp cache. I still think many users (for small-ish apps) will use that one pool.

Update: About the taggableapp cache - it looks like#26929 adds this, without any config. That makes even more sense.

@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedApr 16, 2018
edited
Loading

taggable: true

A service id can also be given here, where tags will be stored. This would then look like:
taggable: some_pool_for_tags. If you're OK, I'm OK :)

add tagging to the app cache

not needed as you spotted in#26929: just type-hintTaggableCacheInterface and done with autowiring (or manually injectcache.app.taggable)

@weaverryan
Copy link
Member

A service id can also be given here, where tags will be stored. This would then look like:
taggable: some_pool_for_tags. If you're OK, I'm OK :)

Ah, of course! I think we should keeptags then

@nicolas-grekasnicolas-grekas modified the milestones:4.1,4.2Apr 20, 2018
@nicolas-grekas
Copy link
MemberAuthor

Moving to 4.2.
ping @symfony/deciders

$pools[$id] =newReference($id);
foreach ($clearer->getArgument(0)as$name =>$ref) {
if ($container->hasDefinition($id = (string)$ref)) {
$pools[$name] =newReference($id);
Copy link
Member

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?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

updated

$definition =newChildDefinition($pool['adapter']);

if ($pool['tags']) {
if ($config['pools'][$pool['tags']]['tags'] ??false) {
Copy link
Member

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?

Copy link
MemberAuthor

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.

@nicolas-grekas
Copy link
MemberAuthor

vote pending @symfony/deciders

@nicolas-grekasnicolas-grekas merged commit896be4c intosymfony:masterMay 29, 2018
nicolas-grekas added a commit that referenced this pull requestMay 29, 2018
…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#9652This PR adds a new configuration option for cache pools:```yamlframework:     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
@nicolas-grekasnicolas-grekas deleted the fwb-cache-tag branchMay 31, 2018 18:36
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh left review comments

@weaverryanweaverryanweaverryan approved these changes

+1 more reviewer

@michaelcullummichaelcullummichaelcullum approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

6 participants

@nicolas-grekas@ostrolucky@weaverryan@michaelcullum@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp