For example, let us say that we have something like this:
.
├── app
│ ├── module1
│ │ └── composer.json
│ └── module2
│ └── composer.json
└── composer.json
In every composer.json we have different dependencies.
How can I install all needed packages with a single command?
For example, you can create a Makefile that combines the necessary steps.
Nonetheless, you can install dependencies for all of the composer.json files by specifying the path to the working directories (the directories containing these composer.json files) using the --working-dir option.
See https://getcomposer.org/doc/03-cli.md#global-options:
--working-dir (-d): If specified, use the given directory as working directory.
MakefileHere's an example:
.PHONY: composer
composer:
composer install --working-dir app/module/1
composer install --working-dir app/module/2
composer install
and then run
$ make composer
Alternatively, have a look at beberlei/fiddler and see Monolithic Repositories with PHP and Composer by Benjamin Eberlei.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With