File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 44
55$ builder = new ContainerBuilder ();
66
7- $ builder = apply_filters ('starter_kit/container_builder ' , $ builder );
8-
97$ builder ->addDefinitions (require __DIR__ . '/dependencies.php ' );
108
119return $ builder ->build ();
Original file line number Diff line number Diff line change 33use Laminas \ConfigAggregator \ConfigAggregator ;
44use Laminas \ConfigAggregator \PhpFileProvider ;
55
6- $ aggregator = new ConfigAggregator ([
6+ // Base providers (theme)
7+ $ providers = [
78 new PhpFileProvider (__DIR__ . '/common/*.php ' ),
89 new PhpFileProvider (__DIR__ . '/ ' . wp_get_environment_type () . '/*.php ' ),
9- ]);
10+ ];
11+
12+ // Allow plugins to inject config files
13+ $ additionalFiles = apply_filters ('starter_kit/config/additional_files ' , []);
14+ foreach ($ additionalFiles as $ file ) {
15+ $ providers [] = new PhpFileProvider ($ file );
16+ }
17+
18+ $ aggregator = new ConfigAggregator ($ providers );
1019
1120return $ aggregator ->getMergedConfig ();
Original file line number Diff line number Diff line change 44
55defined ('ABSPATH ' ) || exit;
66
7+ use StarterKit \Exception \ConfigEntryNotFoundException ;
78use StarterKit \Helper \Config ;
89
910/**
@@ -16,7 +17,7 @@ class Constants
1617 /**
1718 * Defines main constants for the theme.
1819 *
19- * @throws \StarterKit\Exception\ ConfigEntryNotFoundException
20+ * @throws ConfigEntryNotFoundException
2021 */
2122 public static function define (): void
2223 {
You can’t perform that action at this time.
0 commit comments