diff --git a/UPGRADE-7.2.md b/UPGRADE-7.2.md index 1f77b3e2964df..1267b2a07299f 100644 --- a/UPGRADE-7.2.md +++ b/UPGRADE-7.2.md @@ -12,7 +12,7 @@ Cache ----- * `igbinary_serialize()` is not used by default when the igbinary extension is installed - * Deprecate making `cache.app` adapter taggable, use the `cache.app.taggable` adapter instead + * Deprecate making `cache.app` tag aware, use the `cache.app.taggable` service instead Console ------- diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index a7749cd30faad..703151ae64978 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -2389,6 +2389,16 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con } } foreach (['app', 'system'] as $name) { + if ('cache.adapter.redis_tag_aware' === $config[$name]) { + trigger_deprecation('symfony/framework-bundle', '7.2', sprintf( + 'Using the "cache.adapter.redis_tag_aware" adapter for "cache.%s" is deprecated. You can use the "cache.app.taggable" service instead (aliased to the TagAwareCacheInterface for autowiring).', + $name + )); + // throw new LogicException(sprintf( + // 'Using the "cache.adapter.redis_tag_aware" adapter for "cache.%s" is deprecated. You can use the "cache.app.taggable" service instead (aliased to the TagAwareCacheInterface for autowiring).', + // $name + // )); + } $config['pools']['cache.'.$name] = [ 'adapters' => [$config[$name]], 'public' => true, @@ -2396,11 +2406,6 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con ]; } foreach ($config['pools'] as $name => $pool) { - if (\in_array('cache.app', $pool['adapters'] ?? [], true) && $pool['tags']) { - trigger_deprecation('symfony/framework-bundle', '7.2', 'Using the "tags" option with the "cache.app" adapter is deprecated. You can use the "cache.app.taggable" adapter instead (aliased to the TagAwareCacheInterface for autowiring).'); - // throw new LogicException('The "tags" option cannot be used with the "cache.app" adapter. You can use the "cache.app.taggable" adapter instead (aliased to the TagAwareCacheInterface for autowiring).'); - } - $pool['adapters'] = $pool['adapters'] ?: ['cache.app']; $isRedisTagAware = ['cache.adapter.redis_tag_aware'] === $pool['adapters']; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_cacheapp_tagaware.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_cacheapp_tagaware.php index 77606f5b144bd..604b03c9fc5aa 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_cacheapp_tagaware.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache_cacheapp_tagaware.php @@ -6,11 +6,6 @@ 'handle_all_throwables' => true, 'php_errors' => ['log' => true], 'cache' => [ - 'pools' => [ - 'app.tagaware' => [ - 'adapter' => 'cache.app', - 'tags' => true, - ], - ], + 'app' => 'cache.adapter.redis_tag_aware', ], ]); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/cache_cacheapp_tagaware.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/cache_cacheapp_tagaware.xml index 7d59e19d514b8..004912abee095 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/cache_cacheapp_tagaware.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/cache_cacheapp_tagaware.xml @@ -8,8 +8,6 @@ - - - + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/cache_cacheapp_tagaware.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/cache_cacheapp_tagaware.yml index 32ef3d49cdfc9..c19943a8ea253 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/cache_cacheapp_tagaware.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/cache_cacheapp_tagaware.yml @@ -5,7 +5,4 @@ framework: php_errors: log: true cache: - pools: - app.tagaware: - adapter: cache.app - tags: true + app: cache.adapter.redis_tag_aware diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php index 016ae507badc8..9c29494e1e8cd 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php @@ -1861,7 +1861,7 @@ public function testCacheTaggableTagAppliedToPools() */ public function testTaggableCacheAppIsDeprecated() { - $this->expectUserDeprecationMessage('Since symfony/framework-bundle 7.2: Using the "tags" option with the "cache.app" adapter is deprecated. You can use the "cache.app.taggable" adapter instead (aliased to the TagAwareCacheInterface for autowiring).'); + $this->expectUserDeprecationMessage('Since symfony/framework-bundle 7.2: Using the "cache.adapter.redis_tag_aware" adapter for "cache.app" is deprecated. You can use the "cache.app.taggable" service instead (aliased to the TagAwareCacheInterface for autowiring).'); $this->createContainerFromFile('cache_cacheapp_tagaware'); }