Skip to content

Commit 29fef92

Browse files
committed
Adding recursive loading of service configuration
1 parent 885a4a5 commit 29fef92

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

app/AppExtension.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ public function load(array $configs, ContainerBuilder $container): void
1818
{
1919
$loader = new YamlFileLoader($container, new FileLocator());
2020

21-
$loader->load(__DIR__ . '/config/services.yaml');
21+
$regexIterator = new RegexIterator(
22+
new RecursiveIteratorIterator(
23+
new RecursiveDirectoryIterator(__DIR__ . '/config')
24+
),
25+
'/\.yaml/i'
26+
);
27+
28+
/** @var SplFileInfo $file */
29+
foreach ($regexIterator as $file)
30+
{
31+
$loader->load((string) $file);
32+
}
2233
}
2334
}

0 commit comments

Comments
 (0)