Skip to content

Commit b84b589

Browse files
committed
ISSUE-345: load configs from packages
1 parent 848efae commit b84b589

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Core/ApplicationKernel.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,14 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
123123
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
124124
$loader->load($this->getApplicationDir() . '/config/config_modules.yml');
125125

126-
$twigConfigFile = $this->getApplicationDir() . '/config/packages/twig.yaml';
127-
if (file_exists($twigConfigFile)) {
128-
$loader->load($twigConfigFile);
126+
$packagesDir = $this->getApplicationDir() . '/config/packages';
127+
128+
if (is_dir($packagesDir)) {
129+
foreach (glob($packagesDir . '/*.{yaml,yml}') as $configFile) {
130+
if (is_file($configFile)) {
131+
$loader->load($configFile);
132+
}
133+
}
129134
}
130135
}
131136

0 commit comments

Comments
 (0)