Skip to content

Commit 41010fb

Browse files
author
Francesco Placella
committed
I-46: Ensured Drupal is bootstrapped from its root directory.
1 parent 65f9291 commit 41010fb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/DrupalHelper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ public function bootDrupal($drupalRoot)
2626
'HTTP_HOST' => $current_request->getHost(),
2727
];
2828
$request = new Request([], [], [], [], [], $server);
29+
$originalDir = getcwd();
30+
chdir($drupalRoot);
2931
$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod', true, $drupalRoot);
3032
$kernel->boot();
3133
$kernel->loadLegacyIncludes();
34+
chdir($originalDir);
3235
}
3336

3437
/**

0 commit comments

Comments
 (0)