Installation

$ curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin/
$ sudo ln -s /usr/local/bin/composer.phar /usr/local/bin/composer

Examples

Create a composer.json

$ composer init

Install Dependencies (with composer.json)

$ composer install

Install new packages to the composer.json

$ composer require vendor/package       # component search => https://packagist.org/
$ composer require vendor/package:2.*   # 2.* version

Update or Install dependency

$ composer update
$ composer update vendor/package                    # update one dependency
$ composer update vendor/package vendor/package2    # update two dependencies
$ composer update vendor/*                          # update all

Show depends

$ composer depends vendor/package           # 의존 관계를 본다
$ composer depends vendor/package --tree    # 트리 구조로 본다