Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
35ef2c97
Commit
35ef2c97
authored
May 23, 2012
by
effulgentsia
Committed by
Crell
May 23, 2012
Browse files
refs
#1536844
Clean up bootstrap shivs.
parent
14416d10
Changes
5
Hide whitespace changes
Inline
Side-by-side
core/includes/bootstrap.inc
View file @
35ef2c97
...
...
@@ -138,8 +138,7 @@
const
DRUPAL_BOOTSTRAP_PAGE_HEADER
=
5
;
/**
* Seventh bootstrap phase: load code for subsystems and modules; validate and
* fix input data.
* Seventh bootstrap phase: load code for subsystems and modules.
*/
const
DRUPAL_BOOTSTRAP_CODE
=
6
;
...
...
core/includes/common.inc
View file @
35ef2c97
...
...
@@ -5160,13 +5160,10 @@ function drupal_valid_token($token, $value = '', $skip_anonymous = FALSE) {
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
()
{
static
$called
=
FALSE
;
if
(
$called
)
{
return
;
}
$called
=
TRUE
;
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/pager.inc'
;
...
...
@@ -5183,19 +5180,22 @@ function _drupal_bootstrap_code() {
require_once
DRUPAL_ROOT
.
'/core/includes/errors.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
();
// Undo magic quotes
// @todo Remove this: http://drupal.org/node/1569456.
fix_gpc_magic
();
// Load all enabled modules
// Load all enabled modules.
module_load_all
();
// Make sure all stream wrappers are registered.
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'
];
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
(
'error_log'
,
'public://error.log'
);
}
...
...
@@ -5205,6 +5205,9 @@ function _drupal_bootstrap_code() {
* Temporary BC function for scripts not using DrupalKernel.
*
* 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
)
{
static
$called
=
FALSE
;
...
...
core/lib/Drupal/Core/EventSubscriber/LegacyRequestSubscriber.php
View file @
35ef2c97
...
...
@@ -28,6 +28,13 @@ class LegacyRequestSubscriber implements EventSubscriberInterface {
*/
public
function
onKernelRequestLegacy
(
GetResponseEvent
$event
)
{
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
();
drupal_theme_initialize
();
module_invoke_all
(
'init'
);
...
...
core/update.php
View file @
35ef2c97
...
...
@@ -439,9 +439,11 @@ function update_check_requirements($skip_warnings = FALSE) {
install_goto
(
'core/update.php?op=info'
);
}
// Bootstrap, fix requirements, and set the maintenance theme.
drupal_bootstrap
(
DRUPAL_BOOTSTRAP_FULL
);
// Allow update_fix_d8_requirements() to run before code that can break on a
// Drupal 7 database.
drupal_bootstrap
(
DRUPAL_BOOTSTRAP_CODE
);
update_fix_d8_requirements
();
drupal_bootstrap
(
DRUPAL_BOOTSTRAP_FULL
);
drupal_maintenance_theme
();
// Turn error reporting back on. From now on, only fatal errors (which are
...
...
index.php
View file @
35ef2c97
...
...
@@ -32,6 +32,11 @@
// container at some point.
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
);
$dispatcher
=
new
EventDispatcher
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment