summaryrefslogtreecommitdiffstats
path: root/core/authorize.php
diff options
context:
space:
mode:
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.