File tree 2 files changed +18
-0
lines changed
src/Symfony/Bundle/FrameworkBundle
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ CHANGELOG
7
7
* Marked ` MicroKernelTrait::configureRoutes() ` as ` @internal ` and ` @final ` .
8
8
* Deprecated not overriding ` MicroKernelTrait::configureRouting() ` .
9
9
* Added a new ` mailer.message_bus ` option to configure or disable the message bus to use to send mails.
10
+ * Added flex-based default implementation for ` MicroKernelTrait::registerBundles() `
10
11
11
12
5.0.0
12
13
-----
Original file line number Diff line number Diff line change @@ -72,6 +72,19 @@ protected function configureRouting(RoutingConfigurator $routes): void
72
72
*/
73
73
abstract protected function configureContainer (ContainerBuilder $ c , LoaderInterface $ loader );
74
74
75
+ /**
76
+ * {@inheritdoc}
77
+ */
78
+ public function registerBundles (): iterable
79
+ {
80
+ $ contents = require $ this ->getProjectDir ().'/config/bundles.php ' ;
81
+ foreach ($ contents as $ class => $ envs ) {
82
+ if ($ envs [$ this ->environment ] ?? $ envs ['all ' ] ?? false ) {
83
+ yield new $ class ();
84
+ }
85
+ }
86
+ }
87
+
75
88
/**
76
89
* {@inheritdoc}
77
90
*/
@@ -99,6 +112,10 @@ public function registerContainerConfiguration(LoaderInterface $loader)
99
112
$ kernelDefinition ->addTag ('kernel.event_subscriber ' );
100
113
}
101
114
115
+ $ container ->fileExists ($ this ->getProjectDir ().'/config/bundles.php ' );
116
+ $ container ->setParameter ('container.dumper.inline_class_loader ' , \PHP_VERSION_ID < 70400 || !ini_get ('opcache.preload ' ));
117
+ $ container ->setParameter ('container.dumper.inline_factories ' , true );
118
+
102
119
$ this ->configureContainer ($ container , $ loader );
103
120
104
121
$ container ->addObjectResource ($ this );
You can’t perform that action at this time.
0 commit comments