117
117
use Symfony \Component \Yaml \Command \LintCommand as BaseYamlLintCommand ;
118
118
use Symfony \Component \Yaml \Yaml ;
119
119
use Symfony \Contracts \Cache \CacheInterface ;
120
+ use Symfony \Component \Cache \TagAwareCacheInterface ;
120
121
use Symfony \Contracts \HttpClient \HttpClientInterface ;
121
122
use Symfony \Contracts \Service \ResetInterface ;
122
123
use Symfony \Contracts \Service \ServiceSubscriberInterface ;
@@ -1819,10 +1820,6 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
1819
1820
$ pool ['adapter ' ] = '. ' .$ pool ['adapter ' ].'.inner ' ;
1820
1821
}
1821
1822
$ definition = new ChildDefinition ($ 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
- }
1826
1823
1827
1824
if ($ pool ['tags ' ]) {
1828
1825
if ($ config ['pools ' ][$ pool ['tags ' ]]['tags ' ] ?? false ) {
@@ -1837,7 +1834,21 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
1837
1834
$ pool ['name ' ] = $ name ;
1838
1835
$ pool ['public ' ] = false ;
1839
1836
$ 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 (new Reference ($ name ))
1846
+ ;
1847
+ $ container ->registerAliasForArgument ('. ' .$ name .'.taggable ' , TagAwareCacheInterface::class, $ name );
1848
+ $ container ->registerAliasForArgument ($ name , CacheInterface::class);
1849
+ $ container ->registerAliasForArgument ($ name , CacheItemPoolInterface::class);
1840
1850
}
1851
+
1841
1852
$ definition ->setPublic ($ pool ['public ' ]);
1842
1853
unset($ pool ['adapter ' ], $ pool ['public ' ], $ pool ['tags ' ]);
1843
1854
0 commit comments