给Yii composer提速

Yii 2 的 2.1x版本后,采用asset-packagist.org给bower提速,效果明显,旧版本Yii要升级到新版本可以采用以下步骤:

修改 composer.json

  "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',
],

清理composer并运行

composer clear-cache
composer install