In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Xiaobian to share with you Yii2 composer installation slow how to do, I hope you have some harvest after reading this article, let us discuss it together!
Composer is already very convenient for open source projects that reference php in yii, and open source projects that reference front-end also have composer plug-ins fxp-asset (https://github.com/fxpio/composer-asset-plugin) and Asset Packagist (https://github.com/hiqdev/asset-packagist)
Yii used to default to the former, but now the new yii2 template defaults to the latter. The author of the latter is very powerful. It seems that he is a heavy yii user. It seems that he is anxious by the slow execution of fxp-asset, so he has made an updated method.
To get back to business:
So a faster way to install is Asset Packagist https://asset-packagist.org
It's actually two steps:
Close the call to fxp-asset in config
Add the configuration of the asset-packager library to the source list
"config": { "process-timeout": 1800, "fxp-asset": { "enabled": false } }, "repositories": [ { "type": "composer", "url": "https://asset-packagist.org" }]
If the source of the composer uses Aliyun mirror, the complete writing is as follows:
"repositories": { "0": { "type": "composer", "url": "https://asset-packagist.org" }, "packagist": { "type": "composer", "url": "https://mirrors.aliyun.com/composer/" } }
It should be noted that yii also defines bower and npm paths when defining the vendor path in yii\base\Application:
/** * Sets the directory that stores vendor files. * @param string $path the directory that stores vendor files. */ public function setVendorPath($path) { $this->_vendorPath = Yii::getAlias($path); Yii::setAlias('@vendor', $this->_vendorPath); Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower'); Yii::setAlias('@npm', $this->_vendorPath . DIRECTORY_SEPARATOR . 'npm'); }
This differs from the default installation path for asset-packagist:
Redefine bower and npm paths in yii
$config = [ ... 'aliases' => [ '@bower' => '@vendor/bower-asset', '@npm' => '@vendor/npm-asset', ], ... ]; After reading this article, I believe you have a certain understanding of "Yii2 composer installation slow how to do", if you want to know more related knowledge, welcome to pay attention to the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.