File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -210,4 +210,29 @@ public function getLogDir()
210
210
'logs ' ,
211
211
]);
212
212
}
213
+
214
+ /**
215
+ * Registers the bundles defined in config/bundles.php.
216
+ */
217
+ protected function registerConfiguredBundles ()
218
+ {
219
+ $ bundleFilePath = $ this ->getKernelDir ().'/config/bundles.php ' ;
220
+ if (!file_exists ($ bundleFilePath )) {
221
+ return ;
222
+ }
223
+
224
+ $ bundles = require $ bundleFilePath ;
225
+ foreach ($ bundles as $ class => $ environments ) {
226
+ if (isset ($ environments ['all ' ]) || isset ($ environments [$ this ->environment ])) {
227
+ if (!class_exists ($ class )) {
228
+ throw new \InvalidArgumentException (sprintf (
229
+ 'Bundle class "%s" does not exist. ' ,
230
+ $ class
231
+ ));
232
+ }
233
+
234
+ $ this ->requiredBundles [$ class ] = new $ class ();
235
+ }
236
+ }
237
+ }
213
238
}
You can’t perform that action at this time.
0 commit comments