Skip to content
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

[Cache] deprecate all PSR-16 adapters, provide Psr16Cache instead #29236

Merged
merged 1 commit into from Jan 26, 2019

Conversation

Projects
None yet
7 participants
@nicolas-grekas
Copy link
Member

commented Nov 15, 2018

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

@nicolas-grekas nicolas-grekas added this to the next milestone Nov 15, 2018

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch 3 times, most recently from b6e9ae1 to e5c2abb Nov 16, 2018

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch 3 times, most recently from f65edc3 to 4a46b21 Nov 16, 2018

@nicolas-grekas nicolas-grekas changed the title [Cache] deprecate all PSR-16 adapters, provide `Psr16Cache` [Cache] deprecate all PSR-16 adapters, provide Psr16Cache instead Dec 18, 2018

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch 3 times, most recently from cbcd439 to 3c06f7d Dec 19, 2018

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch from 3c06f7d to cb8327c Dec 19, 2018

nicolas-grekas added a commit that referenced this pull request Dec 19, 2018

bug #29648 [Cache] fix Simple\Psr6Cache proxying of metadata (nicolas…
…-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

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch 3 times, most recently from f88902a to 0cf7b2a Dec 19, 2018

@stof

This comment has been minimized.

Copy link
Member

commented Dec 19, 2018

* removed `psr/simple-cache` dependency, run `composer require psr/simple-cache` if you need it

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);

This comment has been minimized.

Copy link
@stof

stof Dec 19, 2018

Member

isn't this reverting your recent change ?

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Dec 19, 2018

Author Member

correct - and the updated test case is now in Psr16AdapterTest

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch from 0cf7b2a to 1c88b86 Dec 19, 2018

@nicolas-grekas

This comment has been minimized.

Copy link
Member Author

commented Dec 19, 2018

Our exceptions implement both the PSR-6 and PSR-16 interfaces, and so both are hard requirements.

Good catch. Fixed by conditionally implementing the PSR-16 one only when it's available.

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch from 1c88b86 to 8c3c20a Dec 19, 2018

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch from 8c3c20a to 529db40 Jan 24, 2019

@nicolas-grekas

This comment has been minimized.

Copy link
Member Author

commented Jan 24, 2019

Now rebased, ready.

Show resolved Hide resolved UPGRADE-4.3.md Outdated

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch 2 times, most recently from b79deb4 to a322860 Jan 25, 2019

@fabpot

This comment has been minimized.

Copy link
Member

commented Jan 25, 2019

Looks like we still need a rebase here :)

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch from a322860 to 63ea665 Jan 25, 2019

@nicolas-grekas

This comment has been minimized.

Copy link
Member Author

commented Jan 25, 2019

oups, rebased.

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:psr16-deprec branch from 63ea665 to 5006be6 Jan 25, 2019

@nicolas-grekas nicolas-grekas merged commit 5006be6 into symfony:master Jan 26, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

nicolas-grekas added a commit that referenced this pull request Jan 26, 2019

feature #29236 [Cache] deprecate all PSR-16 adapters, provide Psr16Ca…
…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

@nicolas-grekas nicolas-grekas deleted the nicolas-grekas:psr16-deprec branch Jan 26, 2019

@enumag

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2019

@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019

@fabpot fabpot referenced this pull request May 9, 2019

Merged

Release v4.3.0-BETA1 #31435

DavidPrevot added a commit to DavidPrevot/symfony that referenced this pull request May 12, 2019

Move psr/simple-cache from dependencies
It has already been moved in cache via symfony#29236.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.