File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -91,15 +91,9 @@ files so they don't collide with the files from ``src/Kernel.php``::
91
91
{
92
92
use MicroKernelTrait;
93
93
94
- public function registerBundles()
94
+ public function getProjectDir(): string
95
95
{
96
- // load only the bundles strictly needed for the API
97
- $contents = require $this->getProjectDir().'/config/api_bundles.php';
98
- foreach ($contents as $class => $envs) {
99
- if ($envs[$this->environment] ?? $envs['all'] ?? false) {
100
- yield new $class();
101
- }
102
- }
96
+ return \dirname(__DIR__);
103
97
}
104
98
105
99
public function getCacheDir(): string
@@ -131,6 +125,12 @@ files so they don't collide with the files from ``src/Kernel.php``::
131
125
$routes->import('../config/api/{routes}/*.yaml');
132
126
// ... load only the config routes strictly needed for the API
133
127
}
128
+
129
+ private function getBundlesPath(): string
130
+ {
131
+ // load only the bundles strictly needed for the API
132
+ return $this->getProjectDir().'/config/api_bundles.php';
133
+ }
134
134
}
135
135
136
136
Step 3) Define the Kernel Configuration
You can’t perform that action at this time.
0 commit comments