diff --git a/src/Bundle/DependencyInjection/NetzmachtContaoLeafletExtension.php b/src/Bundle/DependencyInjection/NetzmachtContaoLeafletExtension.php index 0a894ec..ef67a2e 100644 --- a/src/Bundle/DependencyInjection/NetzmachtContaoLeafletExtension.php +++ b/src/Bundle/DependencyInjection/NetzmachtContaoLeafletExtension.php @@ -49,5 +49,13 @@ class NetzmachtContaoLeafletExtension extends Extension $loader->load('mappers.yml'); $loader->load('encoders.yml'); $loader->load('layers.yml'); + + if (!$container->hasDefinition('netzmacht.contao_leaflet.cache')) { + if ($container->getParameter('kernel.debug')) { + $container->setAlias('netzmacht.contao_leaflet.cache', 'netzmacht.contao_leaflet.cache.debug'); + } else { + $container->setAlias('netzmacht.contao_leaflet.cache', 'netzmacht.contao_leaflet.cache.default'); + } + } } } diff --git a/src/Bundle/Resources/config/services.yml b/src/Bundle/Resources/config/services.yml index 54676f8..c4e6fc3 100644 --- a/src/Bundle/Resources/config/services.yml +++ b/src/Bundle/Resources/config/services.yml @@ -26,9 +26,6 @@ services: arguments: - '%netzmacht.contao_leaflet.filters%' - netzmacht.contao_leaflet.cache: - alias: 'netzmacht.contao_leaflet.cache.default' - netzmacht.contao_leaflet.cache.default: class: Doctrine\Common\Cache\FilesystemCache arguments: