php composer 缓慢,Yii2 composer安装慢的解决办法

修改fxp-asset为Asset Packagist

It uses asset-packagist for managing bower and npm package dependencies through Composer. Also you can use asset-plugin, as in earlier versions, but it works slowly.

找到

"config": {

"process-timeout": 1800,

"fxp-asset":{

"installer-paths": {

"npm-asset-library": "vendor/npm",

"bower-asset-library": "vendor/bower"

}

}

},

"replace": {

"bower-asset/jquery": ">=1.11.0",

"bower-asset/inputmask": ">=3.2.0",

"bower-asset/punycode": ">=1.3.0",

"bower-asset/yii2-pjax": ">=2.0.0"

}

修改为

"config": {

"process-timeout": 1800,

"fxp-asset": {

"enabled": false

}

},

"repositories": [

{

"type": "composer",

"url": "https://asset-packagist.org"

}

]

修改config/main.php

'aliases' => [

'@bower' => '@vendor/bower-asset',

'@npm' => '@vendor/npm-asset',

],

Asset Packagist介绍

Composer + Bower + NPM = friends forever!

This repository allows installation of Bower and NPM packages as native Composer packages.

NO plugins and NO Node.js are required.

At the moment we’ve added most popular Bower and NPM packages 4000+ each.

In case Composer fails to install some asset package, use the search line at the top of the page to check specific package health.

For NPM scoped packages use scope--package instead of @scope/package, e.g. npm-asset/pusher--chatkit.

Got tired of fxp/composer-asset-plugin.

Why Asset Packagist

Got tired of fxp/composer-asset-plugin.

It’s a good project with nice idea and good implementation. But it has some issues: it slows down composer update a lot and requires global installation, so affects all projects. Also there are Travis and Scrutinizer integration special problems, that are a bit annoying.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值