8000 MicroKernelTrait::getBundlesPath · symfony/symfony-docs@16165bd · GitHub
[go: up one dir, main page]

Skip to content

Commit 16165bd

Browse files
committed
MicroKernelTrait::getBundlesPath
1 parent 56d87a8 commit 16165bd

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

configuration/multiple_kernels.rst

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,6 @@ files so they don't collide with the files from ``src/Kernel.php``::
9090
{
9191
use MicroKernelTrait;
9292

93-
public function registerBundles()
94-
{
95-
// load only the bundles strictly needed for the API
96-
$contents = require $this->getProjectDir().'/config/api_bundles.php';
97-
foreach ($contents as $class => $envs) {
98-
if ($envs[$this->environment] ?? $envs['all'] ?? false) {
99-
yield new $class();
100-
}
101-
}
102-
}
103-
10493
public function getProjectDir(): string
10594
{
10695
return \dirname(__DIR__);
@@ -133,6 +122,11 @@ files so they don't collide with the files from ``src/Kernel.php``::
133122
$confDir = $this->getProjectDir().'/config/api';
134123
// ... load only the config routes strictly needed for the API
135124
}
125+
126+
private function getBundlesPath(): string
127+
{
128+
return $this->getProjectDir().'/config/api_bundles.php';
129+
}
136130
}
137131

138132
Step 3) Define the Kernel Configuration

0 commit comments

Comments
 (0)
0