require_once BACKDROP_ROOT . '/core/includes/common.inc'; require_once BACKDROP_ROOT . '/core/includes/file.inc'; require_once BACKDROP_ROOT . '/core/includes/module.inc'; require_once BACKDROP_ROOT . '/core/includes/ajax.inc'; // We prepare only a minimal bootstrap. This includes the database and // variables, however, so we have access to the class autoloader registry. backdrop_bootstrap(BACKDROP_BOOTSTRAP_SESSION); // This must go after backdrop_bootstrap(), which unsets globals! global $conf; // We have to enable the user and system modules, even to check access and // display errors via the maintenance theme. $module_list['system']['filename'] = 'core/modules/system/system.module'; $module_list['user']['filename'] = 'core/modules/user/user.module'; module_list(TRUE, FALSE, FALSE, $module_list); backdrop_load('module', 'system'); backdrop_load('module', 'user'); // We also want to have the language system available, but we do *NOT* want to // actually call backdrop_bootstrap(BACKDROP_BOOTSTRAP_LANGUAGE), since that would // also force us through the BACKDROP_BOOTSTRAP_PAGE_HEADER phase, which loads // all the modules, and that's exactly what we're trying to avoid. backdrop_language_initialize(); // Initialize the maintenance theme for this administrative script. backdrop_maintenance_theme(); $output = ''; $show_messages = TRUE; if (authorize_access_allowed()) { // Load both the Form API and Batch API. require_once BACKDROP_ROOT . '/core/includes/form.inc'; require_once BACKDROP_ROOT . '/core/includes/batch.inc'; // Load the code that drives the authorize process. require_once BACKDROP_ROOT . '/core/includes/authorize.inc';
/** * Perform setup tasks for all page requests. * * This hook is run at the beginning of the page request. It is typically * used to set up global parameters that are needed later in the request. * * If needing to execute code early in the page request, consider using * hook_init() instead. In hook_boot(), only the most basic APIs are available * and not all modules have been loaded. This hook by default is not called on * pages served by the default page cache, but can be enabled through the * $settings['invoke_page_cache_hooks'] option in settings.php. * * @see hook_init() */ function hook_boot() { // We need user_access() in the shutdown function. Make sure it gets loaded. backdrop_load('module', 'user'); backdrop_register_shutdown_function('devel_shutdown'); }
backdrop_bootstrap(BACKDROP_BOOTSTRAP_SESSION); // The interface language global has been renamed in Backdrop, we must ensure // that it contains a valid value while language settings are upgraded. $GLOBALS[LANGUAGE_TYPE_INTERFACE] = language_default(); // Only allow the requirements check to proceed if the current user has access // to run updates (since it may expose sensitive information about the site's // configuration). $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : ''; if (empty($op) && update_access_allowed()) { require_once BACKDROP_ROOT . '/core/includes/install.inc'; require_once BACKDROP_ROOT . '/core/modules/system/system.install'; // Load module basics. include_once BACKDROP_ROOT . '/core/includes/module.inc'; $module_list['system']['filename'] = 'core/modules/system/system.module'; module_list(TRUE, FALSE, FALSE, $module_list); backdrop_load('module', 'system'); // Reset the module_implements() cache so that any new hook implementations // in updated code are picked up. module_implements_reset(); // Set up $language, since the installer components require it. backdrop_language_initialize(); // Set up theme system for the maintenance page. backdrop_maintenance_theme(); // Check the update requirements for Backdrop. Only report on errors at this // stage, since the real requirements check happens further down. update_check_requirements(TRUE); // Redirect to the update information page if all requirements were met. install_goto('core/update.php?op=info'); } // update_fix_requirements() needs to run before bootstrapping beyond path. // So bootstrap to BACKDROP_BOOTSTRAP_LANGUAGE then include unicode.inc.