On a daily basis you get to use only a few of the many commands that Composer has and therefore you should know what each of them do so that you can get your thing done.
The list is as follows:
composer self-update
- ALWAYS keep your composer up to datecomposer install
- this command installs the dependencies as described incomposer.lock
composer update
- this updates ALL your packagescomposer update vendor/package
- this installs new package
Although composer update is rarely used in the real world as you rarely have to go berserk and update every dependency, I have included it here because it's a very common rookie mistake to use it when trying to install a new package and this needs to stop.
Additionally, the composer install
and composer update
commands have a few parameters that you can use. The most common ones are:
--prefer-dist
- basically, this makes composer download zips files instead cloning repos, useful for very very big git repos that cause your process to timeout-v
/-vv
/-vvv
- this increases the verbosity level
Before saying goodbye, I'd like to present you a couple of examples:
composer update tss/automailer-bundle
composer update tss/automailer-bundle --prefer-dist
composer update tss/automailer-bundle --prefer-dist -vvv
The above commands should get you through your usual day without any major problems.
Have fun coding :)