summaryrefslogtreecommitdiffstats
path: root/core/authorize.php
diff options
context:
space:
mode:
authorNathaniel Catchpole2014-06-05 10:30:04 (GMT)
committerNathaniel Catchpole2014-06-05 10:30:04 (GMT)
commitcda051c425ec10e864d3207cc0e60640bfa16e10 (patch)
tree7a273719f52a92c9be0d9f21b5bb7ce47eae84d5 /core/authorize.php
parent2cd0b096b925f0b3693df45c9681acc546c92bc9 (diff)
Issue #2016629 by larowlan, neclimdul, sun, alexpott, jibran, ParisLiakos, donquixote, effulgentsia, msonnabaum: Refactor bootstrap to better utilize the kernel.
Diffstat (limited to 'core/authorize.php')
-rw-r--r--core/authorize.php19
1 files changed, 6 insertions, 13 deletions
diff --git a/core/authorize.php b/core/authorize.php
index f938f39..96fe9ae 100644
--- a/core/authorize.php
+++ b/core/authorize.php
@@ -20,13 +20,15 @@
* @link authorize Authorized operation helper functions @endlink
*/
+use Drupal\Core\DrupalKernel;
+use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Site\Settings;
use Drupal\Core\Page\DefaultHtmlPageRenderer;
// Change the directory to the Drupal root.
chdir('..');
-require_once __DIR__ . '/vendor/autoload.php';
+$autoloader = require_once __DIR__ . '/vendor/autoload.php';
/**
* Global flag to identify update.php and authorize.php runs.
@@ -51,18 +53,9 @@ function authorize_access_allowed() {
return Settings::get('allow_authorize_operations', TRUE) && user_access('administer software updates');
}
-// *** Real work of the script begins here. ***
-
-require_once __DIR__ . '/includes/bootstrap.inc';
-require_once __DIR__ . '/includes/common.inc';
-require_once __DIR__ . '/includes/file.inc';
-require_once __DIR__ . '/includes/module.inc';
-require_once __DIR__ . '/includes/ajax.inc';
-
-// Prepare a minimal bootstrap.
-drupal_bootstrap(DRUPAL_BOOTSTRAP_PAGE_CACHE);
-$request = \Drupal::request();
-\Drupal::service('request_stack')->push($request);
+$request = Request::createFromGlobals();
+$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod');
+$kernel->prepareLegacyRequest($request);
// We have to enable the user and system modules, even to check access and
// display errors via the maintenance theme.