Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

Sign up
Appearance settings

Commitd3d5137

Browse files
[FrameworkBundle] fix named autowiring aliases for TagAwareCacheInterface
1 parent1cd99ea commitd3d5137

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
useSymfony\Component\Yaml\Command\LintCommandasBaseYamlLintCommand;
118118
useSymfony\Component\Yaml\Yaml;
119119
useSymfony\Contracts\Cache\CacheInterface;
120+
useSymfony\Component\Cache\TagAwareCacheInterface;
120121
useSymfony\Contracts\HttpClient\HttpClientInterface;
121122
useSymfony\Contracts\Service\ResetInterface;
122123
useSymfony\Contracts\Service\ServiceSubscriberInterface;
@@ -1819,10 +1820,6 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
18191820
$pool['adapter'] ='.'.$pool['adapter'].'.inner';
18201821
}
18211822
$definition =newChildDefinition($pool['adapter']);
1822-
if (!\in_array($name, ['cache.app','cache.system'],true)) {
1823-
$container->registerAliasForArgument($name, CacheInterface::class);
1824-
$container->registerAliasForArgument($name, CacheItemPoolInterface::class);
1825-
}
18261823

18271824
if ($pool['tags']) {
18281825
if ($config['pools'][$pool['tags']]['tags'] ??false) {
@@ -1837,7 +1834,21 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
18371834
$pool['name'] =$name;
18381835
$pool['public'] =false;
18391836
$name ='.'.$name.'.inner';
1837+
1838+
if (!\in_array($pool['name'], ['cache.app','cache.system'],true)) {
1839+
$container->registerAliasForArgument($pool['name'], TagAwareCacheInterface::class);
1840+
$container->registerAliasForArgument($name, CacheInterface::class,$pool['name']);
1841+
$container->registerAliasForArgument($name, CacheItemPoolInterface::class,$pool['name']);
1842+
}
1843+
}elseif (!\in_array($name, ['cache.app','cache.system'],true)) {
1844+
$container->register('.'.$name.'.taggable', TagAwareAdapter::class)
1845+
->addArgument(newReference($name))
1846+
;
1847+
$container->registerAliasForArgument('.'.$name.'.taggable', TagAwareCacheInterface::class,$name);
1848+
$container->registerAliasForArgument($name, CacheInterface::class);
1849+
$container->registerAliasForArgument($name, CacheItemPoolInterface::class);
18401850
}
1851+
18411852
$definition->setPublic($pool['public']);
18421853
unset($pool['adapter'],$pool['public'],$pool['tags']);
18431854

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp