diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index 0c19a6bdc7a0bb4ecdbf11c19fe5b4e56231c6e0..7d372ade5f3966fad517f10fd9d912b0e20cbd89 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -23,14 +23,8 @@ public function registerBundles() { new CoreBundle(), ); - // Rather than bootstrapping to a higher phase prior to booting the Kernel, which - // would ensure these files are loaded already, we want to boot the Kernel as - // early as possible in the bootstrapping phase. // TODO: Somehow remove the necessity of calling system_list() to find out which // bundles exist. - require_once DRUPAL_ROOT . '/core/includes/cache.inc'; - require_once DRUPAL_ROOT . '/core/includes/module.inc'; - require_once DRUPAL_ROOT . '/core/includes/database.inc'; $modules = array_keys(system_list('module_enabled')); foreach ($modules as $module) { diff --git a/core/modules/system/tests/http.php b/core/modules/system/tests/http.php index 93646850e9656eaf5c9d655699836b679208daca..c91dd0c3778c98689743e7fc1d667a3ed6ab0d81 100644 --- a/core/modules/system/tests/http.php +++ b/core/modules/system/tests/http.php @@ -5,6 +5,7 @@ * Fake an HTTP request, for use during testing. */ +use Drupal\Core\DrupalKernel; use Symfony\Component\HttpFoundation\Request; // Set a global variable to indicate a mock HTTP request. @@ -36,6 +37,7 @@ drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE); -$kernel = drupal_container()->get('httpkernel'); +$kernel = new DrupalKernel('prod', FALSE); +$kernel->boot(); $response = $kernel->handle($request)->prepare($request)->send(); $kernel->terminate($request, $response); diff --git a/core/modules/system/tests/https.php b/core/modules/system/tests/https.php index 11b7e13022cb7f33e2cf59f25ee1f59ae53020fb..5bf000b3c95451bcc32a8d6ba582291e7f97f5f2 100644 --- a/core/modules/system/tests/https.php +++ b/core/modules/system/tests/https.php @@ -5,6 +5,7 @@ * Fake an https request, for use during testing. */ +use Drupal\Core\DrupalKernel; use Symfony\Component\HttpFoundation\Request; // Set a global variable to indicate a mock HTTPS request. @@ -35,6 +36,7 @@ drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE); -$kernel = drupal_container()->get('httpkernel'); +$kernel = new DrupalKernel('prod', FALSE); +$kernel->boot(); $response = $kernel->handle($request)->prepare($request)->send(); $kernel->terminate($request, $response); diff --git a/index.php b/index.php index df4b2b6a78383fa019199b97f2c5104a1668d312..200a2de93c39eda06e0fa8dab98d5aad907cc08f 100644 --- a/index.php +++ b/index.php @@ -30,9 +30,6 @@ // container at some point. request($request); -$kernel = new DrupalKernel('prod', FALSE); -$kernel->boot(); - // Bootstrap all of Drupal's subsystems, but do not initialize anything that // depends on the fully resolved Drupal path, because path resolution happens // during the REQUEST event of the kernel. @@ -40,6 +37,9 @@ // @see Drupal\Core\EventSubscriber\LegacyRequestSubscriber; drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE); +$kernel = new DrupalKernel('prod', FALSE); +$kernel->boot(); + $response = $kernel->handle($request)->prepare($request)->send(); $kernel->terminate($request, $response);