Home >PHP Framework >YII >Why is yii2 installation so slow?

Why is yii2 installation so slow?

藏色散人
藏色散人Original
2020-04-05 10:41:473201browse

Why is yii2 installation so slow?

Why is the installation of yii2 so slow?

In fact, the installation of yii2 itself is very fast, mainly because it contains The js and front-end framework are relatively cumbersome. You can terminate the installation of the front-end js, which will not affect your use.

Modify fxp-asset to Asset Packagist

Refer to the official installation guide Yii advanced template installation mentioned:

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.

Find

"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"
}

and modify it to

"config": {
    "process-timeout": 1800,
    "fxp-asset": {
        "enabled": false
    }
},
"repositories": [
    {
        "type": "composer",
        "url": "https://asset-packagist.org"
    }
]

Modify config/main.php

'aliases' => [
    '@bower' => '@vendor/bower-asset',
    '@npm'   => '@vendor/npm-asset',
],

Related tutorials Recommendation: yii framework

The above is the detailed content of Why is yii2 installation so slow?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn