} catch (HttpExceptionInterface $e) { $response = new Response('', $e->getStatusCode()); $response->prepare($request)->send(); exit; } // We have to enable the user and system modules, even to check access and // display errors via the maintenance theme. \Drupal::moduleHandler()->addModule('system', 'core/modules/system'); \Drupal::moduleHandler()->addModule('user', 'core/modules/user'); \Drupal::moduleHandler()->load('system'); \Drupal::moduleHandler()->load('user'); // Initialize the maintenance theme for this administrative script. drupal_maintenance_theme(); $content = []; $show_messages = TRUE; $is_allowed = authorize_access_allowed($request); // Build content. if ($is_allowed) { // Load both the Form API and Batch API. require_once __DIR__ . '/includes/form.inc'; require_once __DIR__ . '/includes/batch.inc'; if (isset($_SESSION['authorize_page_title'])) { $page_title = $_SESSION['authorize_page_title']; } else { $page_title = t('Authorize file system changes'); } // See if we've run the operation and need to display a report. if (isset($_SESSION['authorize_results']) && ($results = $_SESSION['authorize_results'])) { // Clear the session out. unset($_SESSION['authorize_results']); unset($_SESSION['authorize_operation']);
// display errors via the maintainence theme. $module_list['system']['filename'] = 'modules/system/system.module'; $module_list['user']['filename'] = 'modules/user/user.module'; module_list(TRUE, FALSE, FALSE, $module_list); drupal_load('module', 'system'); drupal_load('module', 'user'); // We also want to have the language system available, but we do *NOT* want to // actually call drupal_bootstrap(DRUPAL_BOOTSTRAP_LANGUAGE), since that would // also force us through the DRUPAL_BOOTSTRAP_PAGE_HEADER phase, which loads // all the modules, and that's exactly what we're trying to avoid. drupal_language_initialize(); // Initialize the maintenance theme for this administrative script. drupal_maintenance_theme(); $output = ''; $show_messages = TRUE; if (authorize_access_allowed()) { // Load both the Form API and Batch API. require_once DRUPAL_ROOT . '/includes/form.inc'; require_once DRUPAL_ROOT . '/includes/batch.inc'; // Load the code that drives the authorize process. require_once DRUPAL_ROOT . '/includes/authorize.inc'; // For the sake of Batch API and a few other low-level functions, we need to // initialize the URL path into $_GET['q']. However, we do not want to raise // our bootstrap level, nor do we want to call drupal_initialize_path(), // since that is assuming that modules are loaded and invoking hooks. // However, all we really care is if we're in the middle of a batch, in which // case $_GET['q'] will already be set, we just initialize it to an empty // string if it's not already defined. if (!isset($_GET['q'])) { $_GET['q'] = ''; }
$response = new Response('', $e->getStatusCode()); $response->prepare($request)->send(); exit; } // We have to enable the user and system modules, even to check access and // display errors via the maintenance theme. \Drupal::moduleHandler()->addModule('system', 'core/modules/system'); \Drupal::moduleHandler()->addModule('user', 'core/modules/user'); \Drupal::moduleHandler()->load('system'); \Drupal::moduleHandler()->load('user'); // Initialize the maintenance theme for this administrative script. drupal_maintenance_theme(); $content = []; $show_messages = TRUE; $response = new Response(); if (authorize_access_allowed($request)) { // Load both the Form API and Batch API. require_once __DIR__ . '/includes/form.inc'; require_once __DIR__ . '/includes/batch.inc'; if (isset($_SESSION['authorize_page_title'])) { $page_title = $_SESSION['authorize_page_title']; } else { $page_title = t('Authorize file system changes'); } // See if we've run the operation and need to display a report. if (isset($_SESSION['authorize_results']) && ($results = $_SESSION['authorize_results'])) { // Clear the session out. unset($_SESSION['authorize_results']); unset($_SESSION['authorize_operation']); unset($_SESSION['authorize_filetransfer_info']); if (!empty($results['page_title'])) {