Locating the splitter logic class is now done in the following way:
The Composer plugin reads the value from the composer.json extra key 'splitter-location', and falls back to 'vendor/wp-cli/wp-cli/php/WP_CLI/AutoloadSplitter.php'.
The main wp-cli/wp-cli package overrides this value through the extra key by setting it to 'php/WP_CLI/AutoloadSplitter.php'.
This works for the framework package, as well as for command packages that pull in the framework package as a dependency.
I don't think it works in every case, though, like for example when both the command package and the framework package are pulled in as dependencies.
We need to think of a reliable way, within the Composer autoloader generator plugin, to find out where the wp-cli/wp-cli package is located.
I tried with the mindplay/composer-locator package, but that one only starts to be usable after the autoloader has been dumped.
Locating the splitter logic class is now done in the following way:
The Composer plugin reads the value from the
composer.json
extra key'splitter-location'
, and falls back to'vendor/wp-cli/wp-cli/php/WP_CLI/AutoloadSplitter.php'
.The main
wp-cli/wp-cli
package overrides this value through the extra key by setting it to'php/WP_CLI/AutoloadSplitter.php'
.This works for the framework package, as well as for command packages that pull in the framework package as a dependency.
I don't think it works in every case, though, like for example when both the command package and the framework package are pulled in as dependencies.
We need to think of a reliable way, within the Composer autoloader generator plugin, to find out where the
wp-cli/wp-cli
package is located.I tried with the
mindplay/composer-locator
package, but that one only starts to be usable after the autoloader has been dumped.