|
12 | 12 | namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
|
13 | 13 |
|
14 | 14 | use Doctrine\Common\Annotations\Reader;
|
| 15 | +use Symfony\Component\Cache\Adapter\AdapterInterface; |
15 | 16 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
16 | 17 | use Symfony\Component\DependencyInjection\ContainerInterface;
|
17 | 18 | use Symfony\Component\DependencyInjection\Definition;
|
|
24 | 25 | use Symfony\Component\Finder\Finder;
|
25 | 26 | use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
26 | 27 | use Symfony\Component\Config\FileLocator;
|
| 28 | +use Symfony\Component\PropertyAccess\PropertyAccessor; |
27 | 29 | use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory;
|
28 | 30 | use Symfony\Component\Serializer\Normalizer\DataUriNormalizer;
|
29 | 31 | use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
|
@@ -1062,6 +1064,15 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
|
1062 | 1064 | $container->setDefinition($name, $definition);
|
1063 | 1065 | }
|
1064 | 1066 |
|
| 1067 | + if (method_exists(PropertyAccessor::class, 'createCache')) { |
| 1068 | + $propertyAccessDefinition = $container->register('cache.property_access', AdapterInterface::class); |
| 1069 | + $propertyAccessDefinition->setPublic(false); |
| 1070 | + $propertyAccessDefinition->setFactory(array(PropertyAccessor::class, 'createCache')); |
| 1071 | + $propertyAccessDefinition->setArguments(array(null, null, $version, new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))); |
| 1072 | + $propertyAccessDefinition->addTag('cache.pool', array('clearer' => 'cache.default_clearer')); |
| 1073 | + $propertyAccessDefinition->addTag('monolog.logger', array('channel' => 'cache')); |
| 1074 | + } |
| 1075 | + |
1065 | 1076 | $this->addClassesToCompile(array(
|
1066 | 1077 | 'Psr\Cache\CacheItemInterface',
|
1067 | 1078 | 'Psr\Cache\CacheItemPoolInterface',
|
|
0 commit comments