Composer 是一个跟踪本地项目和类库依赖的依赖管理器。
访问 https://getcomposer.org/ 以得到更多信息和文档。
-
下载
composer.phar
该可执行包或使用安装器。$ curl -sS https://getcomposer.org/installer | php
-
创建一个 composer.json 文件来定义你的依赖关系。 注意,这个例子只是一个应用程序的小版本,不是为了发布为包自身。 如要创建类库/包,请阅读 guidelines.
{ "require": { "monolog/monolog": ">=1.0.0" } }
-
运行 Composer:
php composer.phar install
-
在这里浏览更多的包(packages ) Packagist.
要运行测试,或开发 Composer 自身, 你必须使用源码而不是上面介绍的phar文件。
- 运行
git clone https://github.com/composer/composer.git
- 下载
composer.phar
可执行文件 - 运行 Composer 来获取依赖:
cd composer && php ../composer.phar install
现在你可以通过执行 bin/composer
脚本来运行 Composer : php /path/to/composer/bin/composer
由于 Composer 是工作在当前目录下的,还可以把它安装在系统范围。
- 改变目录
cd /usr/local/bin
- 获取 Composer
curl -sS https://getcomposer.org/installer | php
- 让phar变为可执行
chmod a+x composer.phar
- 切换到项目路径
cd /path/to/my/project
- 使用 Composer 作为你通常使用的
composer.phar install
- 可选地,你可以把 composer.phar 重命名为 composer 以使它更为方便
Composer 是 homebrew-php 项目的一部分。
- Tap the homebrew-php repository into your brew installation if you haven't done yet:
brew tap josegonzalez/homebrew-php
- 运行
brew install josegonzalez/php/composer
. - 运行
composer
命令来使用Composer。
执行 php composer.phar self-update
或对应地会更新一个phar,用最新的版本来安装的。
All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.
Fork the project, create a feature branch, and send us a pull request.
To ensure a consistent code base, you should make sure the code follows the Coding Standards which we borrowed from Symfony.
If you would like to help take a look at the list of issues.
Mailing lists for user support and development.
IRC channels are on irc.freenode.org: #composer for users and #composer-dev for development.
Stack Overflow has a growing collection of Composer related questions.
PHP 5.3.2 or above (at least 5.3.4 recommended to avoid potential bugs)
Nils Adermann - naderman@naderman.de - http://twitter.com/naderman - http://www.naderman.de
Jordi Boggiano - j.boggiano@seld.be - http://twitter.com/seldaek - http://seld.be
See also the list of contributors who participated in this project.
Composer is licensed under the MIT License - see the LICENSE file for details
- This project's Solver started out as a PHP port of openSUSE's Libzypp satsolver.
- This project uses hiddeninput.exe to prompt for passwords on windows, sources and details can be found on the github page of the project.