Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
220
Merge Requests
220
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
7670ea41
Commit
7670ea41
authored
Mar 04, 2015
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2347625
by alexpott, idebr: Remove drupal_bootstrap and drupal_get_bootstrap_phase
parent
a305f770
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
105 deletions
+5
-105
core/includes/bootstrap.inc
core/includes/bootstrap.inc
+0
-94
core/includes/errors.inc
core/includes/errors.inc
+3
-3
core/includes/install.core.inc
core/includes/install.core.inc
+0
-4
core/includes/utility.inc
core/includes/utility.inc
+0
-2
core/modules/simpletest/src/WebTestBase.php
core/modules/simpletest/src/WebTestBase.php
+2
-2
No files found.
core/includes/bootstrap.inc
View file @
7670ea41
...
...
@@ -53,34 +53,6 @@
*/
const
ERROR_REPORTING_DISPLAY_VERBOSE
=
'verbose'
;
/**
* First bootstrap phase: initialize configuration.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
*/
const
DRUPAL_BOOTSTRAP_CONFIGURATION
=
0
;
/**
* Second bootstrap phase, initialize a kernel.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
*/
const
DRUPAL_BOOTSTRAP_KERNEL
=
1
;
/**
* Third bootstrap phase: load code for subsystems and modules.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
*/
const
DRUPAL_BOOTSTRAP_CODE
=
2
;
/**
* Final bootstrap phase: initialize language, path, theme, and modules.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
*/
const
DRUPAL_BOOTSTRAP_FULL
=
3
;
/**
* Role ID for anonymous users; should match what's in the "role" table.
*/
...
...
@@ -683,59 +655,6 @@ function drupal_get_messages($type = NULL, $clear_queue = TRUE) {
return
array
();
}
/**
* Ensures Drupal is bootstrapped to the specified phase.
*
* In order to bootstrap Drupal from another PHP script, you can use this code:
* @code
* require_once '/path/to/drupal/core/vendor/autoload.php';
* require_once '/path/to/drupal/core/includes/bootstrap.inc';
* drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
* @endcode
*
* @param $phase
* A constant telling which phase to bootstrap to. Possible values:
* - DRUPAL_BOOTSTRAP_CONFIGURATION: Initializes configuration.
* - DRUPAL_BOOTSTRAP_KERNEL: Initializes a kernel.
*
* @return int
* The most recently completed phase.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Interact directly with the kernel.
*/
function
drupal_bootstrap
(
$phase
=
NULL
)
{
// Temporary variables used for booting later legacy phases.
/** @var \Drupal\Core\DrupalKernel $kernel */
static
$kernel
;
static
$boot_level
=
0
;
if
(
isset
(
$phase
))
{
$request
=
Request
::
createFromGlobals
();
for
(
$current_phase
=
$boot_level
;
$current_phase
<=
$phase
;
$current_phase
++
)
{
switch
(
$current_phase
)
{
case
DRUPAL_BOOTSTRAP_CONFIGURATION
:
$classloader
=
require
__DIR__
.
'/../vendor/autoload.php'
;
$kernel
=
DrupalKernel
::
createFromRequest
(
$request
,
$classloader
,
'prod'
);
break
;
case
DRUPAL_BOOTSTRAP_KERNEL
:
$kernel
->
boot
();
break
;
case
DRUPAL_BOOTSTRAP_CODE
:
case
DRUPAL_BOOTSTRAP_FULL
:
$kernel
->
prepareLegacyRequest
(
$request
);
break
;
}
}
$boot_level
=
$phase
;
}
return
\
Drupal
::
hasContainer
()
?
DRUPAL_BOOTSTRAP_CODE
:
DRUPAL_BOOTSTRAP_CONFIGURATION
;
}
/**
* Returns the time zone of the current user.
*/
...
...
@@ -802,19 +721,6 @@ function _drupal_exception_handler($exception) {
}
}
/**
* Returns the current bootstrap phase for this Drupal process.
*
* The current phase is the one most recently completed by drupal_bootstrap().
*
* @see drupal_bootstrap()
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
*/
function
drupal_get_bootstrap_phase
()
{
return
drupal_bootstrap
();
}
/**
* Returns the test prefix if this is an internal request from SimpleTest.
*
...
...
core/includes/errors.inc
View file @
7670ea41
...
...
@@ -121,7 +121,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
// Initialize a maintenance theme if the bootstrap was not complete.
// Do it early because drupal_set_message() triggers a
// \Drupal\Core\Theme\ThemeManager::initTheme().
if
(
$fatal
&&
drupal_get_bootstrap_phase
()
<
DRUPAL_BOOTSTRAP_CODE
)
{
if
(
$fatal
&&
\
Drupal
::
hasService
(
'theme.manager'
)
)
{
// The installer initializes a maintenance theme at the earliest possible
// point in time already. Do not unset that.
if
(
!
$is_installer
)
{
...
...
@@ -258,8 +258,8 @@ function _drupal_log_error($error, $fatal = FALSE) {
/**
* Returns the current error level.
*
* This function should only be used to get the current error level prior to
*
DRUPAL_BOOTSTRAP_KERNEL
or before Drupal is installed. In all other situations
* This function should only be used to get the current error level prior to
the
*
kernel being booted
or before Drupal is installed. In all other situations
* the following code is preferred:
* @code
* \Drupal::config('system.logging')->get('error_level');
...
...
core/includes/install.core.inc
View file @
7670ea41
...
...
@@ -1843,10 +1843,6 @@ function install_finished(&$install_state) {
* Performs batch installation of modules.
*/
function
_install_module_batch
(
$module
,
$module_name
,
&
$context
)
{
// Install and enable the module right away, so that the module will be
// loaded by drupal_bootstrap in subsequent batch requests, and other
// modules possibly depending on it can safely perform their installation
// steps.
\
Drupal
::
service
(
'module_installer'
)
->
install
(
array
(
$module
),
FALSE
);
$context
[
'results'
][]
=
$module
;
$context
[
'message'
]
=
t
(
'Installed %module module.'
,
array
(
'%module'
=>
$module_name
));
...
...
core/includes/utility.inc
View file @
7670ea41
...
...
@@ -15,8 +15,6 @@
/**
* Rebuilds all caches even when Drupal itself does not work.
*
* Requires DRUPAL_BOOTSTRAP_CONFIGURATION.
*
* @param \Composer\Autoload\ClassLoader $classloader
* The classloader.
* @param \Symfony\Component\HttpFoundation\Request $request
...
...
core/modules/simpletest/src/WebTestBase.php
View file @
7670ea41
...
...
@@ -859,8 +859,8 @@ protected function setUp() {
file_put_contents
(
$directory
.
'/services.yml'
,
$yaml
->
dump
(
$services
));
}
// Since Drupal is bootstrapped already, install_begin_request() will not
// bootstrap
into DRUPAL_BOOTSTRAP_CONFIGURATION (again). Hence, we have to
//
reload the newly written custom
settings.php manually.
// bootstrap
again. Hence, we have to reload the newly written custom
// settings.php manually.
$class_loader
=
require
DRUPAL_ROOT
.
'/core/vendor/autoload.php'
;
Settings
::
initialize
(
DRUPAL_ROOT
,
$this
->
siteDirectory
,
$class_loader
);
...
...
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