Composer 基本指令操作使用
註: 若 composer.phar 改名為 composer, 請自行將 "php composer.phar" 替換成 "composer".
下述整理自此篇: Composer command line interface
- init: php composer.phar init
- install: php composer.phar install
- update:
- php composer.phar update
- php composer.phar update vendor/package vendor/package2
- php composer.phar update vendor/*
- require:
- php composer.phar require
- php composer.phar require vendor/package:2.* vendor/package2:dev-master
- search: php composer.phar search monolog
- show:
- php composer.phar show
- php composer.phar show monolog/monolog
- php composer.phar show monolog/monolog 1.0.2
- depends: php composer.phar depends --link-type=require monolog/monolog
- validate: php composer.phar validate # It will check if your composer.json is valid
- status: php composer.phar status # php composer.phar status -v
- self-update: php composer.phar self-update
- Config: php composer.phar config --list
- Modifying Repositories: php composer.phar config repositories.foo vcs http://github.com/foo/bar
- create-project: php composer.phar create-project doctrine/orm path 2.2.0
- help: php composer.phar help install