Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
90 lines (80 loc) · 2.41 KB

File metadata and controls

90 lines (80 loc) · 2.41 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
namespace WP_CLI;
use WP_CLI\Bootstrap\BootstrapState;
use WP_CLI\Bootstrap\BootstrapStep;
/**
* Get the list of ordered steps that need to be processed to bootstrap WP-CLI.
*
* Each entry is a fully qualified class name for a class implementing the
* `WP_CLI\Bootstrap\BootstrapStep` interface.
*
* @return string[]
*/
function get_bootstrap_steps() {
return [
Bootstrap\DeclareFallbackFunctions::class,
Bootstrap\LoadUtilityFunctions::class,
Bootstrap\DeclareMainClass::class,
Bootstrap\DeclareAbstractBaseCommand::class,
Bootstrap\IncludeFrameworkAutoloader::class,
Bootstrap\ConfigureRunner::class,
Bootstrap\InitializeColorization::class,
Bootstrap\InitializeLogger::class,
Bootstrap\InitializeFormatter::class,
Bootstrap\RegisterShutdownHandler::class,
Bootstrap\CheckRoot::class,
Bootstrap\IncludeRequestsAutoloader::class,
Bootstrap\DefineProtectedCommands::class,
Bootstrap\LoadExecCommand::class,
Bootstrap\LoadRequiredCommand::class,
Bootstrap\IncludeFallbackAutoloader::class,
Bootstrap\IncludePackageAutoloader::class,
Bootstrap\RegisterFrameworkCommands::class,
Bootstrap\RegisterDeferredCommands::class,
Bootstrap\InitializeContexts::class,
Bootstrap\LaunchRunner::class,
];
}
/**
* Register the classes needed for the bootstrap process.
*
* The Composer autoloader is not active yet at this point, so we need to use a
* custom autoloader to fetch the bootstrap classes in a flexible way.
*/
function prepare_bootstrap() {
require_once WP_CLI_ROOT . '/php/WP_CLI/Autoloader.php';
$autoloader = new Autoloader();
$autoloader->add_namespace(
'WP_CLI\Bootstrap',
WP_CLI_ROOT . '/php/WP_CLI/Bootstrap'
)->register();
}
/**
* Initialize and return the bootstrap state to pass from step to step.
*
* @return BootstrapState
*/
function initialize_bootstrap_state() {
return new BootstrapState();
}
/**
* Process the bootstrapping steps.
*
* Loops over each of the provided steps, instantiates it and then calls its
* `process()` method.
*/
function bootstrap() {
prepare_bootstrap();
$state = initialize_bootstrap_state();
foreach ( get_bootstrap_steps() as $step ) {
/** @var BootstrapStep $step_instance */
if ( class_exists( 'WP_CLI' ) ) {
\WP_CLI::debug( "Processing bootstrap step: {$step}", 'bootstrap' );
}
/**
* @var BootstrapStep $step_instance
*/
$step_instance = new $step();
$state = $step_instance->process( $state );
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.