V
V
Vadim2016-11-01 12:56:21
PHP
Vadim, 2016-11-01 12:56:21

How to include another composer.json in one composer.json?

There is, for example, composer.json at the root of the project. And there is a bundle directory at the root, where composer.json with its dependencies also lies.
Is it possible to make the composer, when updating, take information from both composer.json and bundle/composer.json, and already update the packages based on the result set?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vadim, 2016-11-01
@vshemarov

Taki found a solution, in case someone else needs it: https://packagist.org/packages/wikimedia/composer-...
This is a composer plugin that does exactly what you need - it merges several composer files into one and itself the composer works already with the resulting file. For me it's the perfect solution.

M
Maxim, 2016-11-01
@pudovMaxim

This is a bit of an odd question, but maybe you should look into ways to use your own packages?
It talks about it here.
Also, if I'm not mistaken, you can perform a small perverted sexual act and write a script that will pull dependencies from the json of the subproject and add them to the main one. But I'm not sure about this. And I don't recommend doing that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question