8000 [Cache] Deprecate support for Doctrine Cache · symfony/symfony@595c786 · GitHub
[go: up one dir, main page]

Skip to content

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

Appearance settings

Commit 595c786

Browse files
committed
[Cache] Deprecate support for Doctrine Cache
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent 98ed693 commit 595c786

File tree

14 files changed

+69
-15
lines changed

14 files changed

+69
-15
lines changed

UPGRADE-5.4.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ UPGRADE FROM 5.3 to 5.4
44
Cache
55
-----
66

7-
* Deprecate `DoctrineProvider` because this class has been added to the `doctrine/cache` package
7+
* Deprecate `DoctrineProvider` and `DoctrineAdapter` because these classes have been added to the `doctrine/cache` package
88

99
Console
1010
-------
@@ -28,6 +28,7 @@ FrameworkBundle
2828
* Deprecate the `AdapterInterface` autowiring alias, use `CacheItemPoolInterface` instead
2929
* Deprecate the public `profiler` service to private
3030
* Deprecate `get()`, `has()`, `getDoctrine()`, and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead
31+
* Deprecate the `cache.adapter.doctrine` service: The Doctrine Cache library is deprecated. Either switch to Symfony Cache or use the PSR-6 adapters provided by Doctrine Cache.
3132

3233
HttpKernel
3334
----------

UPGRADE-6.0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DoctrineBridge
1414
Cache
1515
-----
1616

17-
* Remove `DoctrineProvider` because it has been added to the `doctrine/cache` package
17+
* Remove `DoctrineProvider` and `DoctrineAdapter` because these classes have been added to the `doctrine/cache` package
1818

1919
Config
2020
------
@@ -104,6 +104,7 @@ FrameworkBundle
104104
* Remove option `--output-format` of the `translation:update` command, use e.g. `--output-format=xlf20` instead
105105
* Remove the `AdapterInterface` autowiring alias, use `CacheItemPoolInterface` instead
106106
* Remove `get()`, `has()`, `getDoctrine()`, and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead
107+
* Deprecate the `cache.adapter.doctrine` service: The Doctrine Cache library is deprecated. Either switch to Symfony Cache or use the PSR-6 adapters provided by Doctrine Cache.
107108

108109
HttpFoundation
109110
--------------

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CHANGELOG
99
* Deprecate the public `profiler` service to private
1010
* Deprecate `get()`, `has()`, `getDoctrine()`, and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead
1111
* Add `MicroKernelTrait::getBundlesPath` method to get bundles config path
12+
* Deprecate the `cache.adapter.doctrine` service
1213

1314
5.3
1415
---

src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
A3E2
@@ -93,8 +93,10 @@
9393
->call('setLogger', [service('logger')->ignoreOnInvalid()])
9494
->tag('cache.pool', ['clearer' => 'cache.default_clearer', 'reset' => 'reset'])
9595
->tag('monolog.logger', ['channel' => 'cache'])
96+
;
9697

97-
->set('cache.adapter.doctrine', DoctrineAdapter::class)
98+
if (class_exists(DoctrineAdapter::class)) {
99+
$container->services()->set('cache.adapter.doctrine', DoctrineAdapter::class)
98100
->abstract()
99101
->args([
100102
abstract_arg('Doctrine provider service'),
@@ -108,7 +110,11 @@
108110
'reset' => 'reset',
109111
])
110112
->tag('monolog.logger', ['channel' => 'cache'])
113+
->deprecate('symfony/framework-bundle', '5.4', 'The abstract service "%service_id%" is deprecated.')
114+
;
115+
}
111116

117+
$container->services()
112118
->set('cache.adapter.filesystem', FilesystemAdapter::class)
113119
->abstract()
114120
->args([

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
'adapter' => 'cache.adapter.apcu',
88
'default_lifetime' => 30,
99
],
10-
'cache.bar' => [
11-
'adapter' => 'cache.adapter.doctrine',
12-
'default_lifetime' => 5,
13-
'provider' => 'app.doctrine_cache_provider',
14-
],
1510
'cache.baz' => [
1611
'adapter' => 'cache.adapter.filesystem',
1712
'default_lifetime' => 7,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', [
4+
'cache' => [
5+
'pools' => [
6+
'cache.bar' => [
7+
'adapter' => 'cache.adapter.doctrine',
8+
'default_lifetime' => 5,
9+
'provider' => 'app.doctrine_cache_provider',
10+
],
11+
],
12+
],
13+
]);

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/cache.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<framework:config>
99
<framework:cache>
1010
<framework:pool name="cache.foo" adapter="cache.adapter.apcu" default-lifetime="30" />
11-
<framework:pool name="cache.bar" adapter="cache.adapter.doctrine" default-lifetime="5" provider="app.doctrine_cache_provider" />
1211
<framework:pool name="cache.baz" adapter="cache.adapter.filesystem" default-lifetime="7" />
1312
<framework:pool name="cache.foobar" adapter="cache.adapter.psr6" default-lifetime="10" provider="app.cache_pool" />
1413
<framework:pool name="cache.def" default-lifetime="PT11S" />
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" ?>
2+
<container xmlns="http://symfony.com/schema/dic/services"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:framework="http://symfony.com/schema/dic/symfony"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
6+
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
7+
8+
<framework:config>
9+
<framework:cache>
10+
<framework:pool name="cache.bar" adapter="cache.adapter.doctrine" default-lifetime="5" provider="app.doctrine_cache_provider" />
11+
</framework:cache>
12+
</framework:config>
13+
</container>

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/cache.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ framework:
44
cache.foo:
55
adapter: cache.adapter.apcu
66
default_lifetime: 30
7-
cache.bar:
8-
adapter: cache.adapter.doctrine
9-
default_lifetime: 5
10-
provider: app.doctrine_cache_provider
117
cache.baz:
128
adapter: cache.adapter.filesystem
139
default_lifetime: 7
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
framework:
2+
cache:
3+
pools:
4+
cache.bar:
5+
adapter: cache.adapter.doctrine
6+
default_lifetime: 5
7+
provider: app.doctrine_cache_provider

0 commit comments

Comments
 (0)
0