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

SimpleCacheAdapter fails to cache any item if a namespace is used#32025

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

@moufmouf
Copy link
Contributor

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
LicenseMIT

This is a backport of#32019

The SimpleCacheAdapter extends AdapterTestCase.
When adding a namespace, the AdapterTestCase adds ":" after the namespace:

https://github.com/symfony/symfony/blob/v4.3.1/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php#L37

The namespace is prepended to the cache key.
But in PSR-16, the ":" is a forbidden character.

As a result, the cache key is invalid and cache is not persisted. If you use Psr16Adapter + a namespace, the cache simply does not work.

As per@nicolas-grekas advices, a NS_SEPARATOR const is added to change the namespace separator for theSimpleCacheAdapter to "_" (that is compatible with PSR-16).

The first commit of this PR starts with an additional test and no fix (to showcase the problem).

@moufmoufmoufmoufforce-pushed thebroken_simplecacheadapter_with_namespace branch 4 times, most recently fromca39d00 tob50221cCompareJune 13, 2019 14:17
@moufmouf
Copy link
ContributorAuthor

@nicolas-grekas Ready for review. I think I took into account all your comments.

What do you want me to do with#32019? Shall I close it (if you want to backport the bug from this version?) or shall I continue working on it to make it in line with this PR?

@fabpot
Copy link
Member

Thank you@moufmouf.

moufmouf reacted with thumbs up emoji

@fabpotfabpotforce-pushed thebroken_simplecacheadapter_with_namespace branch from9f8be54 toffd3469CompareJune 14, 2019 11:16
@fabpotfabpot merged commitffd3469 intosymfony:3.4Jun 14, 2019
fabpot added a commit that referenced this pull requestJun 14, 2019
…is used (moufmouf)This PR was squashed before being merged into the 3.4 branch (closes#32025).Discussion----------SimpleCacheAdapter fails to cache any item if a namespace is used| Q             | A| ------------- | ---| Branch?       |3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| License       | MITThis is a backport of#32019The SimpleCacheAdapter extends AdapterTestCase.When adding a namespace, the AdapterTestCase adds ":" after the namespace:https://github.com/symfony/symfony/blob/v4.3.1/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php#L37The namespace is prepended to the cache key.But in PSR-16, the ":" is a forbidden character.As a result, the cache key is invalid and cache is not persisted. If you use Psr16Adapter + a namespace, the cache simply does not work.As per@nicolas-grekas advices, a NS_SEPARATOR const is added to change the namespace separator for the `SimpleCacheAdapter` to "_" (that is compatible with PSR-16).The first commit of this PR starts with an additional test and no fix (to showcase the problem).Commits-------ffd3469 SimpleCacheAdapter fails to cache any item if a namespace is used
This was referencedJun 26, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

4 participants

@moufmouf@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp