Skip to content
Snippets Groups Projects
Commit 73fee52a authored by Katherine Bailey's avatar Katherine Bailey
Browse files

No need to boot the kernel explicitly as it can now get booted just when it's handling the request

parent aef0436e
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -18,23 +18,19 @@ ...@@ -18,23 +18,19 @@
* Root directory of Drupal installation. * Root directory of Drupal installation.
*/ */
define('DRUPAL_ROOT', getcwd()); define('DRUPAL_ROOT', getcwd());
// Bootstrap the lowest level of what we need.
require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
// Create a request object from the HTTPFoundation.
$request = Request::createFromGlobals();
// Bootstrap all of Drupal's subsystems, but do not initialize anything that // Bootstrap all of Drupal's subsystems, but do not initialize anything that
// depends on the fully resolved Drupal path, because path resolution happens // depends on the fully resolved Drupal path, because path resolution happens
// during the REQUEST event of the kernel. // during the REQUEST event of the kernel.
// @see Drupal\Core\EventSubscriber\PathSubscriber; // @see Drupal\Core\EventSubscriber\PathSubscriber;
// @see Drupal\Core\EventSubscriber\LegacyRequestSubscriber; // @see Drupal\Core\EventSubscriber\LegacyRequestSubscriber;
require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE); drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);
$kernel = new DrupalKernel('prod', FALSE); $kernel = new DrupalKernel('prod', FALSE);
$kernel->boot();
// Create a request object from the HTTPFoundation.
$request = Request::createFromGlobals();
$response = $kernel->handle($request)->prepare($request)->send(); $response = $kernel->handle($request)->prepare($request)->send();
$kernel->terminate($request, $response); $kernel->terminate($request, $response);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment