您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“Composer安裝及更新YII2框架會遇到什么問題”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“Composer安裝及更新YII2框架會遇到什么問題”這篇文章吧。
前置條件
首先使用Composer包工具的需要滿足以下兩個前提,不區分操作系統。
1 電腦需要安裝Composer包管理工具,并且全局可直接使用
2 安裝Composer Asset插件,Asset插件需要合適的版本。
兩個條件在安裝的同時,都必須注意合適的版本。以下附上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 設置為全局可用
mv composer.phar /usr/local/bin/composer
安裝完Composer,運行下面的命令來安裝Composer Asset插件
This command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer.
查閱網絡很多資料, Asset插件相關的問題主要集中在【安裝Composer Asset插件老是失敗】,解決方案都是給出執行具體的命令,安裝這個插件的關鍵在于 確定當時fxp/composer-asset-plugin組件的最新版本,然后再安裝。
查看composer-asset-plugin最新版本
https://packagist.org/packages/fxp/composer-asset-plugin
執行如下命令安裝
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
服務器部署YII2 2.0.6,采用PHP7.2 報錯
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].
簡單理解為設置程序遠程更新包時的訪問token,在github處于登錄狀態時,生成token,就可以暢通的下載 形如https://api.github.com/repos/ 這樣的包文件了。
以上是“Composer安裝及更新YII2框架會遇到什么問題”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。