Php Composer 入门

安装

curl -sS https://getcomposer.org/installer | php
sudo mv ~/Learning/php/Composer/composer.phar  /usr/local/bin/composer
composer //即可

安装phpUnit

在项目下新建composer.json,配置号需要的安装包

{
    "require-dev": {
        "phpunit/phpunit-selenium": ">=1.2"
    }
}

安装

cd 项目目录
composer.phar install

//一开始是这样的
Loading composer repositories with package information
Installing dependencies (including require-dev)
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info

//后面再等等好了

设置全局Composer

composer global [全局组件]

使用Composer中Vendor命令

PATH="/Users/maizhikun/.composer/vendor/bin/:${PATH}"

参考链接

安装参考http://www.phpcomposer.com/

php

Comments