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

47 lines
1.3 KiB
PHP
Raw Permalink 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 {
2023-07-21 10:35:15 -04:00
$containerConfigurator->extension('doctrine', [
2022-11-17 15:32:57 -05:00
'orm' => [
'metadata_cache_driver' => [
'type' => 'service',
2023-07-21 10:35:15 -04:00
'id' => 'doctrine.system_cache_provider',
2022-11-17 15:32:57 -05:00
],
'query_cache_driver' => [
'type' => 'service',
2023-07-21 10:35:15 -04:00
'id' => 'doctrine.system_cache_provider',
2022-11-17 15:32:57 -05:00
],
'result_cache_driver' => [
'type' => 'service',
2023-07-21 10:35:15 -04:00
'id' => 'doctrine.result_cache_provider',
],
],
2022-11-17 15:32:57 -05:00
]);
2022-11-03 10:44:05 -04:00
2023-07-21 10:35:15 -04:00
$services = $containerConfigurator->services();
2022-11-03 10:44:05 -04:00
2023-07-21 10:35:15 -04:00
$services->set('doctrine.result_cache_provider', 'Symfony\Component\Cache\DoctrineProvider')
->private()
->args([service('doctrine.result_cache_pool')]);
2022-11-03 10:44:05 -04:00
2023-07-21 10:35:15 -04:00
$services->set('doctrine.system_cache_provider', 'Symfony\Component\Cache\DoctrineProvider')
->private()
->args([service('doctrine.system_cache_pool')]);
2022-11-03 10:44:05 -04:00
2023-07-21 10:35:15 -04:00
$containerConfigurator->extension('framework', [
2022-11-17 15:32:57 -05:00
'cache' => [
'pools' => [
'doctrine.result_cache_pool' => [
2023-07-21 10:35:15 -04:00
'adapter' => 'cache.app',
2022-11-17 15:32:57 -05:00
],
'doctrine.system_cache_pool' => [
2023-07-21 10:35:15 -04:00
'adapter' => 'cache.system',
],
],
],
2022-11-17 15:32:57 -05:00
]);
2022-11-03 10:44:05 -04:00
};