WP_CLI\Bootstrap
IncludeFrameworkAutoloader::process
Process this single bootstrapping step.
Method of the class: IncludeFrameworkAutoloader{}
No Hooks.
Returns
BootstrapState. Modified state to pass to the next step.
Usage
$IncludeFrameworkAutoloader = new IncludeFrameworkAutoloader(); $IncludeFrameworkAutoloader->process( $state );
- $state(BootstrapState) (required)
- Contextual state to pass into the step.
IncludeFrameworkAutoloader::process() IncludeFrameworkAutoloader::process code WP-CLI 2.13.0-alpha
public function process( BootstrapState $state ) {
if ( ! class_exists( 'WP_CLI\Autoloader' ) ) {
require_once WP_CLI_ROOT . '/php/WP_CLI/Autoloader.php';
}
$autoloader = new Autoloader();
$mappings = [
'WP_CLI' => WP_CLI_ROOT . '/php/WP_CLI',
'cli' => WP_CLI_VENDOR_DIR . '/wp-cli/php-cli-tools/lib/cli',
'Symfony\Component\Finder' => WP_CLI_VENDOR_DIR . '/symfony/finder/',
];
foreach ( $mappings as $namespace => $folder ) {
$autoloader->add_namespace(
$namespace,
$folder
);
}
include_once WP_CLI_VENDOR_DIR . '/wp-cli/mustangostang-spyc/Spyc.php';
$autoloader->register();
return $state;
}