From 5cad3cbc3987170a7c77d68e2c3c832b80a00f07 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 21 Dec 2022 14:14:43 +0100 Subject: [PATCH] Moved loading default Core settings to prepend stage --- .../DependencyInjection/IbexaCoreExtension.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php b/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php index 8c2786b2e0..66d019bf16 100644 --- a/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php +++ b/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php @@ -121,9 +121,6 @@ public function load(array $configs, ContainerBuilder $container) $loader->load('routing/js_routing.yml'); } - // Default settings - $this->handleDefaultSettingsLoading($container, $loader); - $this->registerRepositoriesConfiguration($config, $container); $this->registerSiteAccessConfiguration($config, $container); $this->registerImageMagickConfiguration($config, $container); @@ -191,6 +188,9 @@ public function prepend(ContainerBuilder $container) $this->prependTranslatorConfiguration($container); $this->prependDoctrineConfiguration($container); + // Default settings + $this->handleDefaultSettingsLoading($container); + $this->configureGenericSetup($container); $this->configurePlatformShSetup($container); } @@ -229,15 +229,14 @@ private function getMainRepositoryConfigParser(): RepositoryConfigParserInterfac } /** - * Handle default settings. - * - * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container - * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader - * * @throws \Exception */ - private function handleDefaultSettingsLoading(ContainerBuilder $container, FileLoader $loader) + private function handleDefaultSettingsLoading(ContainerBuilder $container): void { + $loader = new Loader\YamlFileLoader( + $container, + new FileLocator(__DIR__ . '/../Resources/config') + ); $loader->load('default_settings.yml'); foreach ($this->defaultSettingsCollection as $fileLocation => $files) {