Skip to content

Commit

Permalink
Merge pull request #47 from plach79/I-46-bootstrap_approot
Browse files Browse the repository at this point in the history
I-46: Ensured Drupal is bootstrapped from its root directory.
  • Loading branch information
RoSk0 authored Dec 5, 2019
2 parents 49e18b8 + 41010fb commit 89be9d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/DrupalHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ public function bootDrupal($drupalRoot)
'HTTP_HOST' => $current_request->getHost(),
];
$request = new Request([], [], [], [], [], $server);
$originalDir = getcwd();
chdir($drupalRoot);
$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod', true, $drupalRoot);
$kernel->boot();
$kernel->loadLegacyIncludes();
chdir($originalDir);
}

/**
Expand Down

0 comments on commit 89be9d0

Please sign in to comment.