WP_CLI\Bootstrap
IncludeFallbackAutoloader::get_autoloader_paths
Get the autoloader paths to scan for an autoloader.
Method of the class: IncludeFallbackAutoloader{}
No Hooks.
Returns
String[]. Array of autoloader paths, or an empty array if none are found.
Usage
// protected - for code of main (parent) or child class $result = $this->get_autoloader_paths();
IncludeFallbackAutoloader::get_autoloader_paths() IncludeFallbackAutoloader::get autoloader paths code WP-CLI 2.13.0-alpha
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;
}