Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
bug #32025 SimpleCacheAdapter fails to cache any item if a namespace …
…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 | MIT 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 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
- Loading branch information
Showing
4 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters