首页 >php框架 >YII >yii2安装为什么很慢

yii2安装为什么很慢

藏色散人
藏色散人原创
2020-04-05 10:41:473194浏览

yii2安装为什么很慢

yii2安装为什么很慢?

其实yii2本身的安装是很快的,主要就是里面包含的js和前端框架是比较繁琐的,可以终止前端js的安装 这不会影响你的使用的.

修改fxp-asset为Asset Packagist

参考官方安装指南Yii advanced template installation提到:

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

相关教程推荐:yii框架

以上是yii2安装为什么很慢的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn