-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packages cannot override bundled commands in Phar anymore #4987
Comments
To get rid of these issues once and for all, I'll decouple the autoloading from the framework (which we want to control) from the autoloading done through Composer (which we don't always control). We already have an autoloader included for the bootstrapping steps, so it's just a matter of replacing the PSR-4 entry in |
I found out why the existing tests did not detect this problem. To keep the dependencies for the tests in check, the bootstrap tests only ever tried to override the The A
|
WP-CLI v2 introduced a regression that the test suite didn't catch: commands that are bundled cannot be overridden anymore by installing them through the package manager.
The main issue is that when the Phar is being assembled, the bundle autoloader and the framework autoloader are combined, and the timing for loading that combined autoloader is adapted for the framework, not the bundled commands.
We previously needed kind of a hack to achieve this overriding, by splitting up the autoloader through a Composer plugin.
While splitting up the packages into two separate ones (one for the framework and one for the bundle) solved this for a Composer stack, the problem still remains for the Phar file ... only that we've since removed the hack to make it work.
The text was updated successfully, but these errors were encountered: