Skip to content

Latest commit

 

History

History
122 lines (81 loc) · 4.35 KB

README.md

File metadata and controls

122 lines (81 loc) · 4.35 KB

Composer - PHP的依赖管理器

Composer 是一个跟踪本地项目和类库依赖的依赖管理器。

访问 https://getcomposer.org/ 以得到更多信息和文档。

Build Status

安装 / 使用

  1. 下载 composer.phar 该可执行包或使用安装器。

    $ curl -sS https://getcomposer.org/installer | php
  2. 创建一个 composer.json 文件来定义你的依赖关系。 注意,这个例子只是一个应用程序的小版本,不是为了发布为包自身。 如要创建类库/包,请阅读 guidelines.

    {
        "require": {
            "monolog/monolog": ">=1.0.0"
        }
    }
  3. 运行 Composer: php composer.phar install

  4. 在这里浏览更多的包(packages ) Packagist.

从源码安装

要运行测试,或开发 Composer 自身, 你必须使用源码而不是上面介绍的phar文件。

  1. 运行 git clone https://github.com/composer/composer.git
  2. 下载 composer.phar 可执行文件
  3. 运行 Composer 来获取依赖: cd composer && php ../composer.phar install

现在你可以通过执行 bin/composer 脚本来运行 Composer : php /path/to/composer/bin/composer

Composer 全局安装(手动)

由于 Composer 是工作在当前目录下的,还可以把它安装在系统范围。

  1. 改变目录 cd /usr/local/bin
  2. 获取 Composer curl -sS https://getcomposer.org/installer | php
  3. 让phar变为可执行 chmod a+x composer.phar
  4. 切换到项目路径 cd /path/to/my/project
  5. 使用 Composer 作为你通常使用的 composer.phar install
  6. 可选地,你可以把 composer.phar 重命名为 composer 以使它更为方便

Composer 全局安装(via homebrew)

Composer 是 homebrew-php 项目的一部分。

  1. Tap the homebrew-php repository into your brew installation if you haven't done yet: brew tap josegonzalez/homebrew-php
  2. 运行 brew install josegonzalez/php/composer.
  3. 运行 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.