溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Composer安裝及更新YII2框架會(huì)遇到什么問題

發(fā)布時(shí)間:2021-11-19 09:56:06 來源:億速云 閱讀:217 作者:小新 欄目:大數(shù)據(jù)

這篇文章主要為大家展示了“Composer安裝及更新YII2框架會(huì)遇到什么問題”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“Composer安裝及更新YII2框架會(huì)遇到什么問題”這篇文章吧。

前置條件

首先使用Composer包工具的需要滿足以下兩個(gè)前提,不區(qū)分操作系統(tǒng)。

1  電腦需要安裝Composer包管理工具,并且全局可直接使用

2 安裝Composer Asset插件,Asset插件需要合適的版本。

兩個(gè)條件在安裝的同時(shí),都必須注意合適的版本。以下附上Mac安裝composer和插件的主要步驟

Mac系統(tǒng)安裝compoer

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 Asset插件

安裝完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].

New personal access token

簡(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)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI