File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
src/Symfony/Bundle/FrameworkBundle Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ CHANGELOG
77 * Add autowiring alias for ` HttpCache\StoreInterface `
88 * Deprecate the ` AdapterInterface ` autowiring alias, use ` CacheItemPoolInterface ` instead
99 * Deprecate the public ` profiler ` service to private
10+ * Add ` MicroKernelTrait::getBundlesPath ` method to get bundles config path
1011
11125.3
1213---
Original file line number Diff line number Diff line change @@ -83,12 +83,20 @@ public function getLogDir(): string
8383 return $ _SERVER ['APP_LOG_DIR ' ] ?? parent ::getLogDir ();
8484 }
8585
86+ /**
87+ * Gets the path to the bundles configuration file.
88+ */
89+ public function getBundlesPath (): string
90+ {
91+ return $ this ->getProjectDir ().'/config/bundles.php ' ;
92+ }
93+
8694 /**
8795 * {@inheritdoc}
8896 */
8997 public function registerBundles (): iterable
9098 {
91- $ contents = require $ this ->getProjectDir (). ' /config/bundles.php ' ;
99+ $ contents = require $ this ->getBundlesPath () ;
92100 foreach ($ contents as $ class => $ envs ) {
93101 if ($ envs [$ this ->environment ] ?? $ envs ['all ' ] ?? false ) {
94102 yield new $ class ();
@@ -124,7 +132,7 @@ public function registerContainerConfiguration(LoaderInterface $loader)
124132 $ kernelDefinition ->addTag ('routing.route_loader ' );
125133
126134 $ container ->addObjectResource ($ this );
127- $ container ->fileExists ($ this ->getProjectDir (). ' /config/bundles.php ' );
135+ $ container ->fileExists ($ this ->getBundlesPath () );
128136
129137 try {
130138 $ configureContainer = new \ReflectionMethod ($ this , 'configureContainer ' );
You can’t perform that action at this time.
0 commit comments