注:以下技巧在composer2下面已经没必要了。!!!!!
升级成composer2吧,全解决了
-------------
因为我一直用Yii2框架。所以安装composer和安装后需要执行的命令如下,【纯记录】
1、下载composer
composer下载(具体详细的还需要:https://getcomposer.org/download/ ,必须 sha 还是经常会变的,鉴于可能经常会变所以注释掉了第二行)
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- #php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
2、mv composer.phar /usr/local/bin/composer #移到系统目录,变成全局命令
3、composer config -g repo.packagist composer https://packagist.phpcomposer.com #国内源
phpcomposer好象垮了!
更新为:composer config -g repo.packagist composer https://packagist.laravel-china.org
4、composer global require hirak/prestissimo #多线程
5、composer global require "fxp/composer-asset-plugin:^1.4" #升级为1.4
6、composer update -vvv
就这样了
合并后的命令
XML/HTML代码
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
- mv composer.phar /usr/local/bin/composer
- composer config -g repo.packagist composer https://packagist.phpcomposer.com
- composer global require hirak/prestissimo
- composer global require "fxp/composer-asset-plugin:^1.4"
- composer update -vvv
- #over
如果采用了git,记得在运行完clone后:git config credential.helper store ,可以将当前用户名和密码存下来(针对HTTP方式,如果是ssh本来就不需要)