10BC0 [Cache] deprecate all PSR-16 adapters, provide Psr16Cache instead by nicolas-grekas · Pull Request #29236 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@nicolas-grekas
Copy link
Member
@nicolas-grekas nicolas-grekas 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

Tobion
Tobion previously requested changes Nov 16, 2018
@nicolas-grekas nicolas-grekas force-pushed the psr16-deprec branch 3 times, most recently from f65edc3 to 4a46b21 Compare November 16, 2018 21:48
@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 psr16-deprec branch 3 times, most recently from cbcd439 to 3c06f7d Compare December 19, 2018 08:44
nicolas-grekas added a commit that referenced this pull request Dec 19, 2018
…-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 psr16-deprec branch 3 times, most recently from f88902a to 0cf7b2a Compare December 19, 2018 09:31
@stof
Copy link
Member
stof 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.

public function createCachePool($defaultLifetime = 0)
{
return new SimpleCacheAdapter(new Psr6Cache(new FilesystemAdapter()), '', $defaultLifetime);
return new SimpleCacheAdapter(new FilesystemCache(), '', $defaultLifetime);
Copy link
Member

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 ?

Copy link
Member Author

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

@nicolas-grekas
Copy link
Member Author

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
Copy link
Member Author

Now rebased, ready.

@nicolas-grekas nicolas-grekas force-pushed the psr16-deprec branch 2 times, most recently from b79deb4 to a322860 Compare January 25, 2019 14:01
@fabpot
Copy link
Member
fabpot commented Jan 25, 2019

Looks like we still need a rebase here :)

@nicolas-grekas
Copy link
Member Author

oups, rebased.

@nicolas-grekas nicolas-grekas merged commit 5006be6 into symfony:master Jan 26, 2019
nicolas-grekas added a commit that referenced this pull request Jan 26, 2019
…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 psr16-deprec branch January 26, 2019 20:52
@enumag
Copy link
Contributor
enumag commented Apr 9, 2019

Missing documentation change. This part is now outdated: https://symfony.com/doc/master/components/cache.html#available-simple-cache-psr-16-classes

@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019
@fabpot fabpot mentioned this pull request May 9, 2019
DavidPrevot added a commit to DavidPrevot/symfony that referenced this pull request May 12, 2019
It has already been moved in cache via symfony#29236.
TomasVotruba pushed a commit to easy-coding-standard/easy-coding-standard that referenced this pull request May 30, 2019
TomasVotruba pushed a commit to easy-coding-standard/easy-coding-standard that referenced this pull request Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

7 participants

0