refs #1536844 Clean up bootstrap shivs.
parent
14416d109e
commit
35ef2c97ea
|
@ -138,8 +138,7 @@ const DRUPAL_BOOTSTRAP_SESSION = 4;
|
||||||
const DRUPAL_BOOTSTRAP_PAGE_HEADER = 5;
|
const DRUPAL_BOOTSTRAP_PAGE_HEADER = 5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Seventh bootstrap phase: load code for subsystems and modules; validate and
|
* Seventh bootstrap phase: load code for subsystems and modules.
|
||||||
* fix input data.
|
|
||||||
*/
|
*/
|
||||||
const DRUPAL_BOOTSTRAP_CODE = 6;
|
const DRUPAL_BOOTSTRAP_CODE = 6;
|
||||||
|
|
||||||
|
|
|
@ -5160,13 +5160,10 @@ function drupal_valid_token($token, $value = '', $skip_anonymous = FALSE) {
|
||||||
return (($skip_anonymous && $user->uid == 0) || ($token == drupal_get_token($value)));
|
return (($skip_anonymous && $user->uid == 0) || ($token == drupal_get_token($value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads code for subsystems and modules, and registers stream wrappers.
|
||||||
|
*/
|
||||||
function _drupal_bootstrap_code() {
|
function _drupal_bootstrap_code() {
|
||||||
static $called = FALSE;
|
|
||||||
|
|
||||||
if ($called) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$called = TRUE;
|
|
||||||
require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'core/includes/path.inc');
|
require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'core/includes/path.inc');
|
||||||
require_once DRUPAL_ROOT . '/core/includes/theme.inc';
|
require_once DRUPAL_ROOT . '/core/includes/theme.inc';
|
||||||
require_once DRUPAL_ROOT . '/core/includes/pager.inc';
|
require_once DRUPAL_ROOT . '/core/includes/pager.inc';
|
||||||
|
@ -5183,19 +5180,22 @@ function _drupal_bootstrap_code() {
|
||||||
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
|
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
|
||||||
require_once DRUPAL_ROOT . '/core/includes/schema.inc';
|
require_once DRUPAL_ROOT . '/core/includes/schema.inc';
|
||||||
|
|
||||||
// Detect string handling method
|
// @todo Move this to earlier in bootstrap: http://drupal.org/node/1569456.
|
||||||
unicode_check();
|
unicode_check();
|
||||||
// Undo magic quotes
|
|
||||||
|
// @todo Remove this: http://drupal.org/node/1569456.
|
||||||
fix_gpc_magic();
|
fix_gpc_magic();
|
||||||
// Load all enabled modules
|
|
||||||
|
// Load all enabled modules.
|
||||||
module_load_all();
|
module_load_all();
|
||||||
|
|
||||||
// Make sure all stream wrappers are registered.
|
// Make sure all stream wrappers are registered.
|
||||||
file_get_stream_wrappers();
|
file_get_stream_wrappers();
|
||||||
|
|
||||||
|
// Now that stream wrappers are registered, log fatal errors from a simpletest
|
||||||
|
// child site to a test specific file directory.
|
||||||
$test_info = &$GLOBALS['drupal_test_info'];
|
$test_info = &$GLOBALS['drupal_test_info'];
|
||||||
if (!empty($test_info['in_child_site'])) {
|
if (!empty($test_info['in_child_site'])) {
|
||||||
// Running inside the simpletest child site, log fatal errors to test
|
|
||||||
// specific file directory.
|
|
||||||
ini_set('log_errors', 1);
|
ini_set('log_errors', 1);
|
||||||
ini_set('error_log', 'public://error.log');
|
ini_set('error_log', 'public://error.log');
|
||||||
}
|
}
|
||||||
|
@ -5205,6 +5205,9 @@ function _drupal_bootstrap_code() {
|
||||||
* Temporary BC function for scripts not using DrupalKernel.
|
* Temporary BC function for scripts not using DrupalKernel.
|
||||||
*
|
*
|
||||||
* DrupalKernel skips this and replicates it via event listeners.
|
* DrupalKernel skips this and replicates it via event listeners.
|
||||||
|
*
|
||||||
|
* @see Drupal\Core\EventSubscriber\PathSubscriber;
|
||||||
|
* @see Drupal\Core\EventSubscriber\LegacyRequestSubscriber;
|
||||||
*/
|
*/
|
||||||
function _drupal_bootstrap_full($skip = FALSE) {
|
function _drupal_bootstrap_full($skip = FALSE) {
|
||||||
static $called = FALSE;
|
static $called = FALSE;
|
||||||
|
|
|
@ -28,6 +28,13 @@ class LegacyRequestSubscriber implements EventSubscriberInterface {
|
||||||
*/
|
*/
|
||||||
public function onKernelRequestLegacy(GetResponseEvent $event) {
|
public function onKernelRequestLegacy(GetResponseEvent $event) {
|
||||||
if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) {
|
if ($event->getRequestType() == HttpKernelInterface::MASTER_REQUEST) {
|
||||||
|
// Prior to invoking hook_init(), initialize the theme (potentially a
|
||||||
|
// custom one for this page), so that:
|
||||||
|
// - Modules with hook_init() implementations that call theme() or
|
||||||
|
// theme_get_registry() don't initialize the incorrect theme.
|
||||||
|
// - The theme can have hook_*_alter() implementations affect page
|
||||||
|
// building (e.g., hook_form_alter(), hook_node_view_alter(),
|
||||||
|
// hook_page_alter()), ahead of when rendering starts.
|
||||||
menu_set_custom_theme();
|
menu_set_custom_theme();
|
||||||
drupal_theme_initialize();
|
drupal_theme_initialize();
|
||||||
module_invoke_all('init');
|
module_invoke_all('init');
|
||||||
|
|
|
@ -439,9 +439,11 @@ if (is_null($op) && update_access_allowed()) {
|
||||||
install_goto('core/update.php?op=info');
|
install_goto('core/update.php?op=info');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bootstrap, fix requirements, and set the maintenance theme.
|
// Allow update_fix_d8_requirements() to run before code that can break on a
|
||||||
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
|
// Drupal 7 database.
|
||||||
|
drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);
|
||||||
update_fix_d8_requirements();
|
update_fix_d8_requirements();
|
||||||
|
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
|
||||||
drupal_maintenance_theme();
|
drupal_maintenance_theme();
|
||||||
|
|
||||||
// Turn error reporting back on. From now on, only fatal errors (which are
|
// Turn error reporting back on. From now on, only fatal errors (which are
|
||||||
|
|
|
@ -32,6 +32,11 @@ $request = Request::createFromGlobals();
|
||||||
// container at some point.
|
// container at some point.
|
||||||
request($request);
|
request($request);
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
// @see Drupal\Core\EventSubscriber\PathSubscriber;
|
||||||
|
// @see Drupal\Core\EventSubscriber\LegacyRequestSubscriber;
|
||||||
drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);
|
drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);
|
||||||
|
|
||||||
$dispatcher = new EventDispatcher();
|
$dispatcher = new EventDispatcher();
|
||||||
|
|
Loading…
Reference in New Issue