Skip to content

Commit 71ce262

Browse files
committed
Check drupal_root from drupal param group
1 parent 32bfb14 commit 71ce262

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Drupal/DrupalAutoloader.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,9 @@ class DrupalAutoloader
6363
public function register(Container $container): void
6464
{
6565
$startPath = null;
66-
$drupalParams = [
67-
'drupal_root' => $container->getParameter('drupal'),
68-
'serviceMap' => [],
69-
'entityTypeStorageMapping' => [],
70-
];
71-
$drupalRoot = $drupalParams['drupal_root'];
72-
if (realpath($drupalRoot) !== false && is_dir($drupalRoot)) {
66+
$drupalParams = $container->getParameter('drupal');
67+
$drupalRoot = $drupalParams['drupal_root'] ?? null;
68+
if ($drupalRoot !== null && realpath($drupalRoot) !== false && is_dir($drupalRoot)) {
7369
$startPath = $drupalRoot;
7470
} else {
7571
$startPath = dirname($GLOBALS['autoloaderInWorkingDirectory']);

0 commit comments

Comments
 (0)