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] Fix cache pool configuration with one adapter and one provider#43164

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

@fancyweb
Copy link
Contributor

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

My current YAML config is:

framework:cache:pools:app.cache.redis:adapter:"cache.adapter.redis"provider:"%env(REDIS_URL)%/4"default_lifetime:86400

I'm trying to migrate it to PHP with the new config builder system. The problem is that->adapter('cache.adapter.redis') does not exist in the generated config class sinceadapter is just a shortcut in the first place. So I have to use->adapters(['cache.adapter.redis']) but the configuration doesn't allow it.

The difference with this patch is that we allow the case whereadapters is a map that contains only one item andprovider is set. The result is exactly the same and it becomes compatible with the config class.

I added an extra check for DX to avoid an\ErrorException ifadapters is not an array.

@fancyweb
Copy link
ContributorAuthor

Failures looks related but it's working on my local and I don't see how the changes could have broken them, I'm going to need some help 😕

@ro0NL
Copy link
Contributor

perhaps more easy to tell config builder about extra methods? maintaining consistency in keys while doing so.

@nicolas-grekas
Copy link
Member

Should we splitadapter andadapters entries instead? Is that possible?
Then the rule would be more clear: adapters XOR adapter+provider

@fancyweb
Copy link
ContributorAuthor

CI is green, so the failures were not related I guess :-)

@nicolas-grekas Splitting the entries couldn't be considered as a bug fix isn'it? I studied the split a bit and it would be more complicated than the current patch.

Is my proposed change too risky for 4.4? I'd really like to fix this issue to get rid of the last yaml config file in my apps 😅

@fancywebfancywebforce-pushed thefwb/fix-cache-adapters-cfg branch from4a77f44 toc4a9dffCompareDecember 11, 2021 11:34
@fancywebfancywebforce-pushed thefwb/fix-cache-adapters-cfg branch fromc4a9dff to863dd5eCompareDecember 11, 2021 11:51
@nicolas-grekas
Copy link
Member

Thank you@fancyweb.

@nicolas-grekasnicolas-grekas merged commit6e54976 intosymfony:4.4Dec 11, 2021
This was referencedDec 29, 2021
@fancywebfancyweb deleted the fwb/fix-cache-adapters-cfg branchDecember 30, 2021 09:12
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@fancyweb@ro0NL@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp