-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] deprecate all PSR-16 adapters, provide Psr16Cache instead #29236
10000 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
b6e9ae1
to
e5c2abb
Compare
f65edc3
to
4a46b21
Compare
Psr16Cache
cbcd439
to
3c06f7d
Compare
3c06f7d
to
cb8327c
Compare
…-grekas) This PR was merged into the 4.2 branch. Discussion ---------- [Cache] fix Simple\Psr6Cache proxying of metadata | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Discovered while working on #29236. Commits ------- 02edc9b [Cache] fix Simple\Psr6Cache proxying of metadata
f88902a
to
0cf7b2a
Compare
isn't this broken ? Our exceptions implement both the PSR-6 and PSR-16 interfaces, and so both are hard requirements. |
@@ -26,6 +26,6 @@ class SimpleCacheAdapterTest extends AdapterTestCase | |||
|
|||
public function createCachePool($defaultLifetime = 0) | |||
{ | |||
return new SimpleCacheAdapter(new Psr6Cache(new FilesystemAdapter()), '', $defaultLifetime); | |||
return new SimpleCacheAdapter(new FilesystemCache(), '', $defaultLifetime); |
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.
isn't this reverting your recent change ?
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.
correct - and the updated test case is now in Psr16AdapterTest
0cf7b2a
to
1c88b86
Compare
Good catch. Fixed by conditionally implementing the PSR-16 one only when it's available. |
1c88b86
to
8c3c20a
Compare
8c3c20a
to
529db40
Compare
Now rebased, ready. |
UPGRADE-4.3.md
Outdated
Show resolved
Hide resolved
b79deb4
to
a322860
Compare
Looks like we still need a rebase here :) |
a322860
to
63ea665
Compare
oups, rebased. |
63ea665
to
5006be6
Compare
…che instead (nicolas-grekas) This PR was merged into the 4.3-dev branch. Discussion ---------- [Cache] deprecate all PSR-16 adapters, provide Psr16Cache instead | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As discussed in #28918, PSR-16 implementations are now mostly useless: either PSR-6 or contracts' CacheInterface is always a better fit. Let's deprecate them all but keep only a `Psr16Cache` to turn any PSR-6 implementation to a PSR-16 one. From the changelog: * removed `psr/simple-cache` dependency, run `composer require psr/simple-cache` if you need it * deprecated all PSR-16 adapters, use `Psr16Cache` or `Symfony\Contracts\Cache\CacheInterface` implementations instead * deprecated `SimpleCacheAdapter`, use `Psr16Adapter` instead * deprecated the "Psr\SimpleCache\CacheInterface" / "cache.app.simple" service, use "Symfony\Contracts\Cache\CacheInterface" / "cache.app" instead Commits ------- 5006be6 [Cache] deprecate all PSR-16 adapters, provide Psr16Cache instead
Missing documentation change. This part is now outdated: https://symfony.com/doc/master/components/cache.html#available-simple-cache-psr-16-classes |
It has already been moved in cache via symfony#29236.
Fixes #1557 See symfony/symfony#29236
Fixes #1557 See symfony/symfony#29236
As discussed in #28918, PSR-16 implementations are now mostly useless: either PSR-6 or contracts' CacheInterface is always a better fit.
Let's deprecate them all but keep only a
Psr16Cache
to turn any PSR-6 implementation to a PSR-16 one.From the changelog:
psr/simple-cache
dependency, runcomposer require psr/simple-cache
if you need itPsr16Cache
orSymfony\Contracts\Cache\CacheInterface
implementations insteadSimpleCacheAdapter
, usePsr16Adapter
instead