collection-crud/config/packages/prod/doctrine.php

47 lines
1.3 KiB
PHP
Raw Normal View History

2022-11-17 15:32:57 -05:00
<?php declare(strict_types=1);
2022-11-03 10:44:05 -04:00
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
return static function (ContainerConfigurator $containerConfigurator): void {
2022-11-17 15:32:57 -05:00
$containerConfigurator->extension('doctrine', [
'orm' => [
'metadata_cache_driver' => [
'type' => 'service',
'id' => 'doctrine.system_cache_provider'
],
'query_cache_driver' => [
'type' => 'service',
'id' => 'doctrine.system_cache_provider'
],
'result_cache_driver' => [
'type' => 'service',
'id' => 'doctrine.result_cache_provider'
]
]
]);
2022-11-03 10:44:05 -04:00
$services = $containerConfigurator->services();
$services->set('doctrine.result_cache_provider', 'Symfony\Component\Cache\DoctrineProvider')
->private()
->args([service('doctrine.result_cache_pool')]);
$services->set('doctrine.system_cache_provider', 'Symfony\Component\Cache\DoctrineProvider')
->private()
->args([service('doctrine.system_cache_pool')]);
2022-11-17 15:32:57 -05:00
$containerConfigurator->extension('framework', [
'cache' => [
'pools' => [
'doctrine.result_cache_pool' => [
'adapter' => 'cache.app'
],
'doctrine.system_cache_pool' => [
'adapter' => 'cache.system'
]
]
]
]);
2022-11-03 10:44:05 -04:00
};