這篇文章主要為大家展示了“Composer安裝及更新YII2框架會(huì)遇到什么問題”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“Composer安裝及更新YII2框架會(huì)遇到什么問題”這篇文章吧。
創(chuàng)新互聯(lián)公司是一家專業(yè)提供田東企業(yè)網(wǎng)站建設(shè),專注與成都做網(wǎng)站、成都網(wǎng)站建設(shè)、H5網(wǎng)站設(shè)計(jì)、小程序制作等業(yè)務(wù)。10年已為田東眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站建設(shè)公司優(yōu)惠進(jìn)行中。
前置條件
首先使用Composer包工具的需要滿足以下兩個(gè)前提,不區(qū)分操作系統(tǒng)。
1 電腦需要安裝Composer包管理工具,并且全局可直接使用
2 安裝Composer Asset插件,Asset插件需要合適的版本。
兩個(gè)條件在安裝的同時(shí),都必須注意合適的版本。以下附上Mac安裝composer和插件的主要步驟
curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...
Composer (version 1.8.0) successfully installed to: /Users/wangmingming/composer.phar
Use it: php composer.phar
將composer 設(shè)置為全局可用
mv composer.phar /usr/local/bin/composer
安裝完Composer,運(yùn)行下面的命令來安裝Composer Asset插件
This command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer.
查閱網(wǎng)絡(luò)很多資料, Asset插件相關(guān)的問題主要集中在【安裝Composer Asset插件老是失敗】,解決方案都是給出執(zhí)行具體的命令,安裝這個(gè)插件的關(guān)鍵在于 確定當(dāng)時(shí)fxp/composer-asset-plugin組件的最新版本,然后再安裝。
查看composer-asset-plugin最新版本
https://packagist.org/packages/fxp/composer-asset-plugin
執(zhí)行如下命令安裝
composer global require "fxp/composer-asset-plugin:~1.4.4"
Changed current directory to /Users/path/.composer.
/composer.json has been updatedLoading composer repositories with package information
Updating dependencies (including require-dev)Package operations: 0 installs, 1 update, 0 removals - Updating fxp/composer-asset-plugin (v1.2.2 => v1.4.4): Loading from cache
Writing lock fileGenerating autoload files
服務(wù)器部署YII2 2.0.6,采用PHP7.2 報(bào)錯(cuò)
For compatibiliy with [PHP 7.2 which does not allow classes to be named `Object` anymore](https://wiki.php.net/rfc/object-typehint), we needed to rename `yii\base\Object` to `yii\base\BaseObject`. `yii\base\Object` still exists for backwards compatibility and will be loaded if needed in projects that are running on PHP <7.2. The compatibility class `yii\base\Object` extends from `yii\base\BaseObject` so if you have classes that extend from `yii\base\Object` these would still work. What does not work however will be code that relies on `instanceof` checks or `is_subclass_of()` calls for `yii\base\Object` on framework classes as these do not extend `yii\base\Object` anymore but only extend from `yii\base\BaseObject`. In general such a check is not needed as there is a `yii\base\Configurable` interface you should check against instead.
更新YII2 框架至2.0.14 遇到問題
Problem 1 - yiisoft/yii2 2.0.15.1 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found. - yiisoft/yii2 2.0.15 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found. - yiisoft/yii2 2.0.14.2 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found. - yiisoft/yii2 2.0.14.1 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found. - yiisoft/yii2 2.0.14 requires bower-asset/inputmask ~3.2.2 | ~3.3.5 -> no matching package found. - Installation request for yiisoft/yii2 ~2.0.14 -> satisfiable by yiisoft/yii2[2.0.14, 2.0.14.1, 2.0.14.2, 2.0.15, 2.0.15.1].
簡(jiǎn)單理解為設(shè)置程序遠(yuǎn)程更新包時(shí)的訪問token,在github處于登錄狀態(tài)時(shí),生成token,就可以暢通的下載 形如https://api.github.com/repos/ 這樣的包文件了。
以上是“Composer安裝及更新YII2框架會(huì)遇到什么問題”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
新聞標(biāo)題:Composer安裝及更新YII2框架會(huì)遇到什么問題
分享地址:http://www.rwnh.cn/article30/gposso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)公司、品牌網(wǎng)站設(shè)計(jì)、、微信公眾號(hào)、虛擬主機(jī)、定制網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)