wikimedia / composer-merge-plugin

Merge one or more additional composer.json files at Composer runtime
MIT License
926 stars 160 forks source link

document the order of the merge result #174

Open joachim-n opened 5 years ago

joachim-n commented 5 years ago

The README doesn't say what order elements of the merge result will be.

This can be important, for example with 'installer-paths', overrides to specific packages must come before the path definition for the package type as a whole.

bd808 commented 5 years ago

It is a bit hidden in the replace section, but it is in there:

Files are loaded in the order specified by the include setting with globbed files being processed in alphabetical order.

joachim-n commented 5 years ago

Ah, I hadn't spotted that!

Files are loaded in the order specified by the include setting with globbed files being processed in alphabetical order.

Presumably that ordering considers the relative path, rather than just the filename, since in many cases, files will be called 'composer.json'?

What happens with the merge result if 'replace' is set to false?

Also, the docs only say what happens with packages:

By default, Composer's conflict resolution engine is used to determine which version of a package should be installed when multiple files specify the same package.

What happens with other sections, such as 'installer-paths'?