WP_CLI\Bootstrap
IncludeFallbackAutoloader{}└─ AutoloaderStep
Class IncludeFallbackAutoloader.
Loads the fallback autoloader that is provided through the composer.json file.
No Hooks.
Usage
$IncludeFallbackAutoloader = new IncludeFallbackAutoloader(); // use class methods
Methods
- protected get_autoloader_paths()
Notes
- Package: WP_CLI\Bootstrap
IncludeFallbackAutoloader{} IncludeFallbackAutoloader{} code WP-CLI 2.13.0-alpha
final class IncludeFallbackAutoloader extends AutoloaderStep {
/**
* Get the autoloader paths to scan for an autoloader.
*
* @return string[] Array of autoloader paths, or an empty array if none are found.
*/
protected function get_autoloader_paths() {
$autoloader_paths = [
WP_CLI_VENDOR_DIR . '/autoload.php',
];
$custom_vendor = $this->get_custom_vendor_folder();
if ( false !== $custom_vendor ) {
array_unshift(
$autoloader_paths,
WP_CLI_ROOT . '/../../../' . $custom_vendor . '/autoload.php'
);
}
WP_CLI::debug(
sprintf(
'Fallback autoloader paths: %s',
implode( ', ', $autoloader_paths )
),
'bootstrap'
);
return $autoloader_paths;
}
}