Closed fritzmg closed 7 years ago
The loading could simply be changed to:
$loader->load(function (ContainerBuilder $container) use ($loader) {
$environment = $container->getParameter('kernel.environment');
if (file_exists($this->getRootDir().'/config/config.yml')) {
$loader->load($this->getRootDir().'/config/config.yml');
}
if (file_exists($this->getRootDir().'/config/config_'.$environment.'.yml')) {
$loader->load($this->getRootDir().'/config/config_'.$environment.'.yml');
}
});
The application does follow the standard behavior. You have to import the config.yml
in your config_prod.yml
if you need it. See https://github.com/symfony/symfony-standard/blob/3.3/app/config/config_prod.yml#L2
Right, sorry for the confusion :)
The config file handling of the Contao Managed Edition behaves differently than in the standard symfony application setup. Usually you can have the following files:
The contents of the
config.yml
are always loaded and then depending on the environment, theconfig_prod.yml
orconfig_dev.yml
is loaded additionally.This is not the case in the ContaoKernel:
Here the
config.yml
only serves as a fallback. So if aconfig_prod.yml
orconfig_dev.yml
is present, only that config file is loaded.