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' ); } $step_instance = new $step(); $state = $step_instance->process( $state ); } }