I am running into an issue with WP CLI and composer.
It appears to be due to WP CLI now utilizing composer prior to loading the WP application logic. More specifically, as I am using composer myself in my application logic to load and handle my own dependencies, when it comes time to call upon a class that should be auto-loadable it fatals out as it is unable to find it.
Steps to reproduce:
In wp-content/ create a composer.json file with the following:
I am running into an issue with WP CLI and composer.
It appears to be due to WP CLI now utilizing composer prior to loading the WP application logic. More specifically, as I am using composer myself in my application logic to load and handle my own dependencies, when it comes time to call upon a class that should be auto-loadable it fatals out as it is unable to find it.
Steps to reproduce:
In wp-content/ create a composer.json file with the following:
In
wp-content/mu-plugins/
create the directoryapp
and a file insideapp.php
with the following:Load
mu-plugins/app/app.php
by creating aload.php
inmu-plugins/load.php
with the following:Run
composer update
at thewp-content/
directory path.Load the site in a browser, see that it loads correctly/fine and properly executes the
app.php
logic.Attempt to run
wp
on the same site, and see that it fatals on theArrilot\DotEnv\DotEnv
load attempt: