Skip to content

Commit 1172add

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: [Mime] Fix encoding filenames in multipart/form-data [Validator] Improve French translation [Translations] Add missing translations for Galician (gl) [DependencyInjection] fix linting callable classes alias `cache.app.taggable` to `cache.app` if using `cache.adapter.redis_tag_aware` restore the overriden locale on tearDown - avoid interfering with any configured value [DependencyInjection] Cast tag value to string
2 parents 26211c8 + c972949 commit 1172add

8 files changed

+90
-1
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2229,7 +2229,9 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
22292229
$pool['reset'] = 'reset';
22302230
}
22312231

2232-
if ($isRedisTagAware) {
2232+
if ($isRedisTagAware && 'cache.app' === $name) {
2233+
$container->setAlias('cache.app.taggable', $name);
2234+
} elseif ($isRedisTagAware) {
22332235
$tagAwareId = $name;
22342236
$container->setAlias('.'.$name.'.inner', $name);
22352237
} elseif ($pool['tags']) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', [
4+
'cache' => [
5+
'app' => 'cache.adapter.redis_tag_aware',
6+
],
7+
]);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', [
4+
'cache' => [
5+
'app' => 'cache.redis_tag_aware.bar',
6+
'pools' => [
7+
'cache.redis_tag_aware.foo' => [
8+
'adapter' => 'cache.adapter.redis_tag_aware',
9+
],
10+
'cache.redis_tag_aware.bar' => [
11+
'adapter' => 'cache.redis_tag_aware.foo',
12+
],
13+
],
14+
],
15+
]);
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:app>cache.adapter.redis_tag_aware</framework:app>
11+
</framework:cache>
12+
</framework:config>
13+
</container>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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:app>cache.redis_tag_aware.bar</framework:app>
11+
<framework:pool name="cache.redis_tag_aware.foo" adapter="cache.adapter.redis_tag_aware" />
12+
<framework:pool name="cache.redis_tag_aware.bar" adapter="cache.redis_tag_aware.foo" />
13+
</framework:cache>
14+
</framework:config>
15+
</container>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
cache:
3+
app: cache.adapter.redis_tag_aware
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
framework:
2+
cache:
3+
app: cache.redis_tag_aware.bar
4+
pools:
5+
cache.redis_tag_aware.foo:
6+
adapter: cache.adapter.redis_tag_aware
7+
cache.redis_tag_aware.bar:
8+
adapter: cache.redis_tag_aware.foo

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,32 @@ public function testRedisTagAwareAdapter()
16881688
}
16891689
}
16901690

1691+
/**
1692+
* @dataProvider testAppRedisTagAwareConfigProvider
1693+
*/
1694+
public function testAppRedisTagAwareAdapter()
1695+
{
1696+
$container = $this->createContainerFromFile('cache_app_redis_tag_aware');
1697+
1698+
foreach ([TagAwareCacheInterface::class, CacheInterface::class, CacheItemPoolInterface::class] as $alias) {
1699+
$def = $container->findDefinition($alias);
1700+
1701+
while ($def instanceof ChildDefinition) {
1702+
$def = $container->getDefinition($def->getParent());
1703+
}
1704+
1705+
$this->assertSame(RedisTagAwareAdapter::class, $def->getClass());
1706+
}
1707+
}
1708+
1709+
public function testAppRedisTagAwareConfigProvider(): array
1710+
{
1711+
return [
1712+
['cache_app_redis_tag_aware'],
1713+
['cache_app_redis_tag_aware_pool'],
1714+
];
1715+
}
1716+
16911717
public function testRemovesResourceCheckerConfigCacheFactoryArgumentOnlyIfNoDebug()
16921718
{
16931719
$container = $this->createContainer(['kernel.debug' => true]);

0 commit comments

Comments
 (0)