10000 [Cache] Remove support for Doctrine Cache · symfony/symfony@d4a0d83 · GitHub
[go: up one dir, main page]

Skip to content

Commit d4a0d83

Browse files
committed
[Cache] Remove support for Doctrine Cache
1 parent d20e06d commit d4a0d83

File tree

14 files changed

+8
-283
lines changed

14 files changed

+8
-283
lines changed

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ CHANGELOG
1919
* Remove all other values than "none", "php_array" and "file" for `framework.annotation.cache`
2020
* Register workflow services as private
2121
* Remove support for passing a `RouteCollectionBuilder` to `MicroKernelTrait::configureRoutes()`, type-hint `RoutingConfigurator` instead
22+
* Remove the `cache.adapter.doctrine` service
2223

2324
5.4
2425
---

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\Cache\Adapter\AdapterInterface;
1717
use Symfony\Component\Cache\Adapter\ApcuAdapter;
1818
use Symfony\Component\Cache\Adapter\ArrayAdapter;
19-
use Symfony\Component\Cache\Adapter\DoctrineAdapter;
2019
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
2120
use Symfony\Component\Cache\Adapter\MemcachedAdapter;
2221
use Symfony\Component\Cache\Adapter\PdoAdapter;
@@ -93,28 +92,7 @@
9392
->call('setLogger', [service('logger')->ignoreOnInvalid()])
9493
->tag('cache.pool', ['clearer' => 'cache.default_clearer', 'reset' => 'reset'])
9594
->tag('monolog.logger', ['channel' => 'cache'])
96-
;
9795

98-
if (class_exists(DoctrineAdapter::class)) {
99-
$container->services()->set('cache.adapter.doctrine', DoctrineAdapter::class)
100-
->abstract()
101-
->args([
102-
abstract_arg('Doctrine provider service'),
103-
'', // namespace
104-
0, // default lifetime
105-
])
106-
->call('setLogger', [service('logger')->ignoreOnInvalid()])
107-
->tag('cache.pool', [
108-
'provider' => 'cache.default_doctrine_provider',
109-
'clearer' => 'cache.default_clearer',
110-
'reset' => 'reset',
111-
])
112-
->tag('monolog.logger', ['channel' => 'cache'])
113-
->deprecate('symfony/framework-bundle', '5.4', 'The abstract service "%service_id%" is deprecated.')
114-
;
115-
}
116-
117-
$container->services()
11896
->set('cache.adapter.filesystem', FilesystemAdapter::class)
11997
->abstract()
12098
->args([

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

Lines changed: 0 additions & 13 deletions
This file was deleted.

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

Lines changed: 0 additions & 13 deletions
This file was deleted.

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

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use Symfony\Component\Cache\Adapter\ApcuAdapter;
2525
use Symfony\Component\Cache\Adapter\ArrayAdapter;
2626
use Symfony\Component\Cache\Adapter\ChainAdapter;
27-
use Symfony\Component\Cache\Adapter\DoctrineAdapter;
2827
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
2928
use Symfony\Component\Cache\Adapter\ProxyAdapter;
3029
use Symfony\Component\Cache\Adapter\RedisAdapter;
@@ -1522,23 +1521,6 @@ public function testCachePoolServices()
15221521
}
15231522
}
15241523

1525-
/**
1526-
* @group legacy
1527-
*/
1528-
public function testDoctrineCache()
1529-
{
1530-
if (!class_exists(DoctrineAdapter::class)) {
1531-
self::markTestSkipped('This test requires symfony/cache 5.4 or lower.');
1532-
}
1533-
1534-
$container = $this->createContainerFromFile('doctrine_cache', [], true, false);
1535-
$container->setParameter('cache.prefix.seed', 'test');
1536-
$container->addCompilerPass(new CachePoolPass());
1537-
$container->compile();
1538-
1539-
$this->assertCachePoolServiceDefinitionIsCreated($container, 'cache.bar', 'cache.adapter.doctrine', 5);
1540-
}
1541-
15421524
public function testRedisTagAwareAdapter()
15431525
{
15441526
$container = $this->createContainerFromFile('cache', [], true);
@@ -1973,9 +1955,6 @@ private function assertCachePoolServiceDefinitionIsCreated(ContainerBuilder $con
19731955
case 'cache.adapter.apcu':
19741956
$this->assertSame(ApcuAdapter::class, $parentDefinition->getClass());
19751957
break;
1976-
case 'cache.adapter.doctrine':
1977-
$this->assertSame(DoctrineAdapter::class, $parentDefinition->getClass());
1978-
break;
19791958
case 'cache.app':
19801959
case 'cache.adapter.filesystem':
19811960
$this->assertSame(FilesystemAdapter::class, $parentDefinition->getClass());

src/Symfony/Component/Cache/Adapter/DoctrineAdapter.php

Lines changed: 0 additions & 110 deletions
This file was deleted.

src/Symfony/Component/Cache/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
6.0
55
---
66

7-
* Remove `DoctrineProvider`
7+
* Remove `DoctrineProvider` and `DoctrineAdapter`
88

99
5.4
1010
---

src/Symfony/Component/Cache/LockRegistry.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ final class LockRegistry
4141
__DIR__.\DIRECTORY_SEPARATOR.'Adapter'.\DIRECTORY_SEPARATOR.'ChainAdapter.php',
4242
__DIR__.\DIRECTORY_SEPARATOR.'Adapter'.\DIRECTORY_SEPARATOR.'CouchbaseBucketAdapter.php',
4343
__DIR__.\DIRECTORY_SEPARATOR.'Adapter'.\DIRECTORY_SEPARATOR.'CouchbaseCollectionAdapter.php',
44-
__DIR__.\DIRECTORY_SEPARATOR.'Adapter'.\DIRECTORY_SEPARATOR.'DoctrineAdapter.php',
4544
__DIR__.\DIRECTORY_SEPARATOR.'Adapter'.\DIRECTORY_SEPARATOR.'FilesystemAdapter.php',
4645
__DIR__.\DIRECTORY_SEPARATOR.'Adapter'.\DIRECTORY_SEPARATOR.'FilesystemTagAwareAdapter.php',
4746
__DIR__.\DIRECTORY_SEPARATOR.'Adapter'.\DIRECTORY_SEPARATOR.'MemcachedAdapter.php',

src/Symfony/Component/Cache/Tests/Adapter/DoctrineAdapterTest.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Symfony/Component/Cache/Tests/DependencyInjection/CacheCollectorPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
namespace Symfony\Component\Cache\Tests\DependencyInjection;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\Cache\Adapter\ArrayAdapter;
1516
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
1617
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
1718
use Symfony\Component\Cache\Adapter\TagAwareAdapter;
1819
use Symfony\Component\Cache\Adapter\TraceableAdapter;
1920
use Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter;
2021
use Symfony\Component\Cache\DataCollector\CacheDataCollector;
2122
use Symfony\Component\Cache\DependencyInjection\CacheCollectorPass;
22-
use Symfony\Component\Cache\Tests\Fixtures\ArrayCache;
2323
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
2424
use Symfony\Component\DependencyInjection\ContainerBuilder;
2525
use Symfony\Component\DependencyInjection\Definition;
@@ -79,7 +79,7 @@ public function testProcessCacheObjectsAreDecorated()
7979
$collector = $container->register('data_collector.cache', CacheDataCollector::class);
8080

8181
$container
82-
->register('cache.object', ArrayCache::class)
82+
->register('cache.object', ArrayAdapter::class)
8383
->addTag('cache.pool', ['name' => 'cache.object']);
8484

8585
$container

src/Symfony/Component/Cache/Tests/Fixtures/ArrayCache.php

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/Symfony/Component/Cache/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
},
3131
"require-dev": {
3232
"cache/integration-tests": "dev-master",
33-
"doctrine/cache": "^1.6|^2.0",
3433
"doctrine/dbal": "^2.10|^3.0",
3534
"predis/predis": "^1.1",
3635
"psr/simple-cache": "^1.0",

src/Symfony/Component/Cache/phpunit.xml.dist

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@
4040
<element key="time-sensitive">
4141
<array>
4242
<element key="0"><string>Cache\IntegrationTests</string></element>
43-
<element key="1"><string>Doctrine\Common\Cache</string></element>
44-
<element key="2"><string>Symfony\Component\Cache</string></element>
45-
<element key="3"><string>Symfony\Component\Cache\Tests\Fixtures</string></element>
46-
<element key="4"><string>Symfony\Component\Cache\Tests\Traits</string></element>
47-
<element key="5"><string>Symfony\Component\Cache\Traits</string></element>
43+
<element key="1"><string>Symfony\Component\Cache</string></element>
44+
<element key="2"><string>Symfony\Component\Cache\Tests\Fixtures</string></element>
45+
<element key="3"><string>Symfony\Component\Cache\Tests\Traits</string></element>
46+
<element key="4"><string>Symfony\Component\Cache\Traits</string></element>
4847
</array>
4948
</element>
5049
</array>

0 commit comments

Comments
 (0)
0