8000 alias `cache.app.taggable` to `cache.app` if using `cache.adapter.red… · symfony/symfony@9676bd6 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

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 9676bd6

Browse files
committed
alias cache.app.taggable to cache.app if using cache.adapter.redis_tag_aware
1 parent b2e7fcd commit 9676bd6

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
---
66

77
* Environment variable `SYMFONY_IDE` is read by default when `framework.ide` config is not set.
8+
* When `cache.app` is `cache.adapter.redis_tag_aware`, set `cache.app.taggable` as an alias.
89

910
6.0
1011
---

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,6 +2103,15 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
21032103
'tags' => false,
21042104
];
21052105
}
2106+
2107+
if ('cache.adapter.redis_tag_aware' === $config['app']) {
2108+
$container->setAlias('cache.app.taggable', 'cache.app');
2109+
} else {
2110+
$container->register('cache.app.taggable', TagAwareAdapter::class)
2111+
->addArgument(new Reference('cache.app'))
2112+
;
2113+
}
2114+
21062115
foreach ($config['pools'] as $name => $pool) {
21072116
$pool['adapters'] = $pool['adapters'] ?: ['cache.app'];
21082117

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

Lines changed: 0 additions & 4 deletions
A28C
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use Symfony\Component\Cache\Adapter\ProxyAdapter;
2424
use Symfony\Component\Cache\Adapter\RedisAdapter;
2525
use Symfony\Component\Cache\Adapter\RedisTagAwareAdapter;
26-
use Symfony\Component\Cache\Adapter\TagAwareAdapter;
2726
use Symfony\Component\Cache\Marshaller\DefaultMarshaller;
2827
use Symfony\Component\Cache\Messenger\EarlyExpirationHandler;
2928
use Symfony\Component\HttpKernel\CacheClearer\Psr6CacheClearer;
@@ -37,9 +36,6 @@
3736
->public()
3837
->tag('cache.pool', ['clearer' => 'cache.app_clearer'])
3938

40-
->set('cache.app.taggable', TagAwareAdapter::class)
41-
->args([service('cache.app')])
42-
4339
->set('cache.system')
4440
->parent('cache.adapter.system')
4541
->public()

0 commit comments

Comments
 (0)
0