Information below covers what you need to know about most composer. Note: If you have installed composer globally then you can use composer instead of php composer.phar.


Facts



Add a new dependency


Adding a new dependency into composer.json with command line and install it.


php composer.phar require (or require --dev) inanzzz/inanzzz-bundle: 1.1.1 

Install manually added dependency


Installing a package which was added to composer.json manually.


php composer.phar update inanzzz/inanzzz-bundle

First time installation


Installing project first time.


php composer.phar install

Remove an existing dependency


Removing a dependency which exists in composer.json.


php composer.phar remove inanzzz/inanzzz-bundle

Remove a non-existing dependency


Removing a dependency which doesn't exist in composer.json.


php composer.phar update inanzzz/inanzzz-bundle

Remove composer cache


rm -rf ~/.composer/

Update composer itself


php composer.phar self update