Open wgevaert opened 1 year ago
Well I got exactly the same error here. I temporarily resolved in my conposer (version 2) to add the require_once and that way I temporarily solved the problem. However, I think Wikimedia has this problem.
I just want to mention that it seems the solution was proposed here but never reviewed:
Using
{ "extra": { "merge-plugin": { "include": [ "extensions/*/composer.json" ] } }
sometimes gives error of the formwhen
optimize-autoloader
istrue
. EDIT: Also whenoptimize-autoloader
isfalse
.I stripped down my MW-installation to the following MWE to demonstrate the issue:
EDIT: Here is an even more minimal example:
composer.json
:test-dependency/composer.json
:test-dependency/Test.php
:END OF EDIT
composer.json
:composer.local.json
:index.php
:With these files set up, reproduce the issue as follows:
composer update
twice.php -S localhost:8000
and then go tolocalhost:8000
in your browser, or just runphp index.php
.When you run
composer update
once, everything works, but when done twice it does not.In this case the files
./vendor/composer/autoload_static.php
and./vendor/composer/autoload_files.php
look something likeand
respectively. This forces composer to load these files two times, resulting in the error described above.
I use
php
version7.4.30
andcomposer
version2.4.1
.