use Drupal\Core\Site\Settings;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
// Change the directory to the Drupal root.
chdir('..'
);
$autoloader =
require_once __DIR__ . '/../autoload.php';
require_once __DIR__ . '/includes/utility.inc';
$request = Request::
createFromGlobals();
// Manually resemble early bootstrap of DrupalKernel::boot().
DrupalKernel::
bootEnvironment();
try { Settings::
initialize(dirname(__DIR__
), DrupalKernel::
findSitePath($request),
$autoloader);
}catch (HttpExceptionInterface
$e) { $response =
new Response('',
$e->
getStatusCode());
$response->
prepare($request)->
send();
exit;
}