diff --git a/src/DependencyInjection/PrestaSitemapExtension.php b/src/DependencyInjection/PrestaSitemapExtension.php index cc39365..deb4597 100644 --- a/src/DependencyInjection/PrestaSitemapExtension.php +++ b/src/DependencyInjection/PrestaSitemapExtension.php @@ -30,9 +30,6 @@ public function load(array $configs, ContainerBuilder $container): void $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../../config')); - $loader->load('services.xml'); - $container->setParameter($this->getAlias() . '.dump_directory', (string)$config['dump_directory']); $container->setParameter($this->getAlias() . '.timetolive', (int)$config['timetolive']); $container->setParameter($this->getAlias() . '.sitemap_file_prefix', (string)$config['sitemap_file_prefix']); @@ -40,6 +37,9 @@ public function load(array $configs, ContainerBuilder $container): void $container->setParameter($this->getAlias() . '.defaults', $config['defaults']); $container->setParameter($this->getAlias() . '.default_section', (string)$config['default_section']); + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../../config')); + $loader->load('services.xml'); + if (true === $config['route_annotation_listener']) { $loader->load('route_annotation_listener.xml');