基于 Composer 更新 Yii 2 至最新版本,将 Yii Framework 从 2.0.35 版本升级到 2.0.41.1
1、之前已安装 Composer,为确保使用最新版本。可以通过运行 composer self-update 来更新 Composer 至版本 2.0.12,如图1
PS E:\> composer self-update Updating to version 2.0.12 (stable channel). Downloading (100%) Use composer self-update --rollback to return to version 1.10.6
2、通过运行 composer update 来更新 Yii 2 至最新版本,已将 Yii Framework 从 2.0.35 版本升级到 2.0.41.1,如图2
PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer update The "fxp/composer-asset-plugin" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option. Loading composer repositories with package information Updating dependencies Lock file operations: 1 install, 68 updates, 1 removal - Removing fzaninotto/faker (v1.9.1) - Upgrading behat/gherkin (v4.6.2 => v4.8.0) - Upgrading bower-asset/jquery (3.4.1 => 3.5.1) - Upgrading codeception/codeception (4.1.5 => 4.1.20) - Upgrading codeception/lib-asserts (1.12.0 => 1.13.2) - Upgrading codeception/lib-innerbrowser (1.3.1 => 1.4.2) - Upgrading codeception/module-asserts (1.2.1 => 1.3.1) - Upgrading codeception/module-filesystem (1.0.2 => 1.0.3) - Upgrading codeception/module-yii2 (1.1.0 => 1.1.2) - Upgrading codeception/phpunit-wrapper (8.1.2 => 8.1.4) - Upgrading codeception/stub (3.6.1 => 3.7.0) - Upgrading doctrine/instantiator (1.3.1 => 1.4.0) - Upgrading egulias/email-validator (2.1.17 => 3.1.1) - Upgrading ezyang/htmlpurifier (v4.12.0 => v4.13.0) - Locking fakerphp/faker (v1.14.1) - Upgrading guzzlehttp/psr7 (1.6.1 => 1.8.1) - Upgrading myclabs/deep-copy (1.9.5 => 1.10.2) - Upgrading opis/closure (3.5.3 => 3.6.2) - Upgrading paragonie/random_compat (v2.0.18 => v2.0.19) - Upgrading phar-io/manifest (1.0.3 => 2.0.1) - Upgrading phar-io/version (2.0.1 => 3.1.0) - Upgrading phpdocumentor/reflection-common (2.1.0 => 2.2.0) - Upgrading phpdocumentor/reflection-docblock (5.1.0 => 5.2.2) - Upgrading phpdocumentor/type-resolver (1.1.0 => 1.4.0) - Upgrading phpspec/php-diff (v1.1.0 => v1.1.3) - Upgrading phpspec/prophecy (v1.10.3 => 1.13.0) - Upgrading phpunit/php-code-coverage (7.0.10 => 7.0.14) - Upgrading phpunit/php-file-iterator (2.0.2 => 2.0.3) - Upgrading phpunit/php-timer (2.1.2 => 2.1.3) - Upgrading phpunit/php-token-stream (3.1.1 => 4.0.4) - Upgrading phpunit/phpunit (8.5.5 => 8.5.15) - Upgrading psr/container (1.0.0 => 1.1.1) - Upgrading sebastian/code-unit-reverse-lookup (1.0.1 => 1.0.2) - Upgrading sebastian/comparator (3.0.2 => 3.0.3) - Upgrading sebastian/diff (3.0.2 => 3.0.3) - Upgrading sebastian/environment (4.2.3 => 4.2.4) - Upgrading sebastian/exporter (3.1.2 => 3.1.3) - Upgrading sebastian/global-state (3.0.0 => 3.0.1) - Upgrading sebastian/object-enumerator (3.0.3 => 3.0.4) - Upgrading sebastian/object-reflector (1.1.1 => 1.1.2) - Upgrading sebastian/recursion-context (3.0.0 => 3.0.1) - Upgrading sebastian/resource-operations (2.0.1 => 2.0.2) - Upgrading sebastian/type (1.1.3 => 1.1.4) - Upgrading swiftmailer/swiftmailer (v6.2.3 => v6.2.7) - Upgrading symfony/console (v5.1.0 => v5.2.6) - Upgrading symfony/css-selector (v5.1.0 => v5.2.4) - Upgrading symfony/deprecation-contracts (v2.1.2 => v2.2.0) - Upgrading symfony/dom-crawler (v4.4.9 => v4.4.20) - Upgrading symfony/event-dispatcher (v5.1.0 => v5.2.4) - Upgrading symfony/event-dispatcher-contracts (v2.1.2 => v2.2.0) - Upgrading symfony/finder (v5.1.0 => v5.2.4) - Upgrading symfony/polyfill-ctype (v1.17.0 => v1.22.1) - Upgrading symfony/polyfill-iconv (v1.17.0 => v1.22.1) - Upgrading symfony/polyfill-intl-grapheme (v1.17.0 => v1.22.1) - Upgrading symfony/polyfill-intl-idn (v1.17.0 => v1.22.1) - Upgrading symfony/polyfill-intl-normalizer (v1.17.0 => v1.22.1) - Upgrading symfony/polyfill-mbstring (v1.17.0 => v1.22.1) - Upgrading symfony/polyfill-php72 (v1.17.0 => v1.22.1) - Upgrading symfony/polyfill-php73 (v1.17.0 => v1.22.1) - Upgrading symfony/polyfill-php80 (v1.17.0 => v1.22.1) - Upgrading symfony/service-contracts (v2.1.2 => v2.2.0) - Upgrading symfony/string (v5.1.0 => v5.2.6) - Upgrading symfony/yaml (v5.1.0 => v5.2.5) - Upgrading theseer/tokenizer (1.1.3 => 1.2.0) - Upgrading webmozart/assert (1.8.0 => 1.10.0) - Upgrading yiisoft/yii2 (2.0.35 => 2.0.41.1) - Upgrading yiisoft/yii2-composer (2.0.9 => 2.0.10) - Upgrading yiisoft/yii2-debug (2.1.13 => 2.1.16) - Upgrading yiisoft/yii2-faker (2.0.4 => 2.0.5) - Upgrading yiisoft/yii2-httpclient (2.0.12 => 2.0.13) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 1 install, 68 updates, 1 removal - Downloading yiisoft/yii2-composer (2.0.10) - Downloading behat/gherkin (v4.8.0) - Downloading bower-asset/jquery (3.5.1) - Downloading sebastian/diff (3.0.3) - Downloading sebastian/recursion-context (3.0.1) - Downloading sebastian/exporter (3.1.3) - Downloading sebastian/comparator (3.0.3) - Downloading sebastian/type (1.1.4) - Downloading sebastian/resource-operations (2.0.2) - Downloading sebastian/object-reflector (1.1.2) - Downloading sebastian/object-enumerator (3.0.4) - Downloading sebastian/global-state (3.0.1) - Downloading sebastian/environment (4.2.4) - Downloading phpunit/php-timer (2.1.3) - Downloading phpunit/php-file-iterator (2.0.3) - Downloading theseer/tokenizer (1.2.0) - Downloading phpunit/php-token-stream (4.0.4) - Downloading phpunit/php-code-coverage (7.0.14) - Downloading phpspec/prophecy (1.13.0) - Downloading phar-io/version (3.1.0) - Downloading phar-io/manifest (2.0.1) - Downloading phpunit/phpunit (8.5.15) - Downloading codeception/phpunit-wrapper (8.1.4) - Downloading codeception/lib-asserts (1.13.2) - Downloading symfony/deprecation-contracts (v2.2.0) - Downloading symfony/yaml (v5.2.5) - Downloading symfony/finder (v5.2.4) - Downloading symfony/event-dispatcher-contracts (v2.2.0) - Downloading symfony/event-dispatcher (v5.2.4) - Downloading symfony/css-selector (v5.2.4) - Downloading symfony/string (v5.2.6) - Downloading symfony/console (v5.2.6) - Downloading guzzlehttp/psr7 (1.8.1) - Downloading codeception/stub (3.7.0) - Downloading codeception/codeception (4.1.20) - Downloading codeception/module-asserts (1.3.1) - Downloading codeception/module-filesystem (1.0.3) - Downloading symfony/dom-crawler (v4.4.20) - Downloading codeception/lib-innerbrowser (1.4.2) - Downloading codeception/module-yii2 (1.1.2) - Downloading symfony/polyfill-php72 (v1.22.1) - Downloading symfony/polyfill-intl-idn (v1.22.1) - Downloading egulias/email-validator (3.1.1) - Downloading ezyang/htmlpurifier (v4.13.0) - Downloading yiisoft/yii2 (2.0.41.1) - Downloading yiisoft/yii2-httpclient (2.0.13) - Downloading paragonie/random_compat (v2.0.19) - Downloading symfony/polyfill-iconv (v1.22.1) - Downloading opis/closure (3.6.2) - Downloading yiisoft/yii2-debug (2.1.16) - Downloading fakerphp/faker (v1.14.1) - Downloading yiisoft/yii2-faker (2.0.5) - Downloading phpspec/php-diff (v1.1.3) - Downloading swiftmailer/swiftmailer (v6.2.7) - Removing fzaninotto/faker (v1.9.1) - Upgrading yiisoft/yii2-composer (2.0.9 => 2.0.10): Extracting archive - Upgrading behat/gherkin (v4.6.2 => v4.8.0): Extracting archive - Upgrading bower-asset/jquery (3.4.1 => 3.5.1): Extracting archive - Upgrading sebastian/diff (3.0.2 => 3.0.3): Extracting archive - Upgrading sebastian/recursion-context (3.0.0 => 3.0.1): Extracting archive - Upgrading sebastian/exporter (3.1.2 => 3.1.3): Extracting archive - Upgrading sebastian/comparator (3.0.2 => 3.0.3): Extracting archive - Upgrading sebastian/type (1.1.3 => 1.1.4): Extracting archive - Upgrading sebastian/resource-operations (2.0.1 => 2.0.2): Extracting archive - Upgrading sebastian/object-reflector (1.1.1 => 1.1.2): Extracting archive - Upgrading sebastian/object-enumerator (3.0.3 => 3.0.4): Extracting archive - Upgrading sebastian/global-state (3.0.0 => 3.0.1): Extracting archive - Upgrading sebastian/environment (4.2.3 => 4.2.4): Extracting archive - Upgrading phpunit/php-timer (2.1.2 => 2.1.3): Extracting archive - Upgrading phpunit/php-file-iterator (2.0.2 => 2.0.3): Extracting archive - Upgrading theseer/tokenizer (1.1.3 => 1.2.0): Extracting archive - Upgrading sebastian/code-unit-reverse-lookup (1.0.1 => 1.0.2): Extracting archive - Upgrading phpunit/php-token-stream (3.1.1 => 4.0.4): Extracting archive - Upgrading phpunit/php-code-coverage (7.0.10 => 7.0.14): Extracting archive - Upgrading symfony/polyfill-ctype (v1.17.0 => v1.22.1): Extracting archive - Upgrading webmozart/assert (1.8.0 => 1.10.0): Extracting archive - Upgrading phpdocumentor/reflection-common (2.1.0 => 2.2.0): Extracting archive - Upgrading phpdocumentor/type-resolver (1.1.0 => 1.4.0): Extracting archive - Upgrading phpdocumentor/reflection-docblock (5.1.0 => 5.2.2): Extracting archive - Upgrading doctrine/instantiator (1.3.1 => 1.4.0): Extracting archive - Upgrading phpspec/prophecy (v1.10.3 => 1.13.0): Extracting archive - Upgrading phar-io/version (2.0.1 => 3.1.0): Extracting archive - Upgrading phar-io/manifest (1.0.3 => 2.0.1): Extracting archive - Upgrading myclabs/deep-copy (1.9.5 => 1.10.2): Extracting archive - Upgrading phpunit/phpunit (8.5.5 => 8.5.15): Extracting archive - Upgrading codeception/phpunit-wrapper (8.1.2 => 8.1.4): Extracting archive - Upgrading codeception/lib-asserts (1.12.0 => 1.13.2): Extracting archive - Upgrading symfony/deprecation-contracts (v2.1.2 => v2.2.0): Extracting archive - Upgrading symfony/yaml (v5.1.0 => v5.2.5): Extracting archive - Upgrading symfony/finder (v5.1.0 => v5.2.4): Extracting archive - Upgrading symfony/polyfill-php80 (v1.17.0 => v1.22.1): Extracting archive - Upgrading symfony/event-dispatcher-contracts (v2.1.2 => v2.2.0): Extracting archive - Upgrading symfony/event-dispatcher (v5.1.0 => v5.2.4): Extracting archive - Upgrading symfony/css-selector (v5.1.0 => v5.2.4): Extracting archive - Upgrading symfony/polyfill-mbstring (v1.17.0 => v1.22.1): Extracting archive - Upgrading symfony/polyfill-intl-normalizer (v1.17.0 => v1.22.1): Extracting archive - Upgrading symfony/polyfill-intl-grapheme (v1.17.0 => v1.22.1): Extracting archive - Upgrading symfony/string (v5.1.0 => v5.2.6): Extracting archive - Upgrading psr/container (1.0.0 => 1.1.1): Extracting archive - Upgrading symfony/service-contracts (v2.1.2 => v2.2.0): Extracting archive - Upgrading symfony/polyfill-php73 (v1.17.0 => v1.22.1): Extracting archive - Upgrading symfony/console (v5.1.0 => v5.2.6): Extracting archive - Upgrading guzzlehttp/psr7 (1.6.1 => 1.8.1): Extracting archive - Upgrading codeception/stub (3.6.1 => 3.7.0): Extracting archive - Upgrading codeception/codeception (4.1.5 => 4.1.20): Extracting archive - Upgrading codeception/module-asserts (1.2.1 => 1.3.1): Extracting archive - Upgrading codeception/module-filesystem (1.0.2 => 1.0.3): Extracting archive - Upgrading symfony/dom-crawler (v4.4.9 => v4.4.20): Extracting archive - Upgrading codeception/lib-innerbrowser (1.3.1 => 1.4.2): Extracting archive - Upgrading codeception/module-yii2 (1.1.0 => 1.1.2): Extracting archive - Upgrading symfony/polyfill-php72 (v1.17.0 => v1.22.1): Extracting archive - Upgrading symfony/polyfill-intl-idn (v1.17.0 => v1.22.1): Extracting archive - Upgrading egulias/email-validator (2.1.17 => 3.1.1): Extracting archive - Upgrading ezyang/htmlpurifier (v4.12.0 => v4.13.0): Extracting archive - Upgrading yiisoft/yii2 (2.0.35 => 2.0.41.1): Extracting archive - Upgrading yiisoft/yii2-httpclient (2.0.12 => 2.0.13): Extracting archive - Upgrading paragonie/random_compat (v2.0.18 => v2.0.19): Extracting archive - Upgrading symfony/polyfill-iconv (v1.17.0 => v1.22.1): Extracting archive - Upgrading opis/closure (3.5.3 => 3.6.2): Extracting archive - Upgrading yiisoft/yii2-debug (2.1.13 => 2.1.16): Extracting archive - Installing fakerphp/faker (v1.14.1): Extracting archive - Upgrading yiisoft/yii2-faker (2.0.4 => 2.0.5): Extracting archive - Upgrading phpspec/php-diff (v1.1.0 => v1.1.3): Extracting archive - Upgrading swiftmailer/swiftmailer (v6.2.3 => v6.2.7): Extracting archive Package flow/jsonpath is abandoned, you should avoid using it. Use softcreatr/jsonpath instead. Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Generating autoload files 47 packages you are using are looking for funding. Use the `composer fund` command to find out more! Seems you have upgraded Yii Framework from version 2.0.35 to 2.0.41.1. Please check the upgrade notes for possible incompatible changes and adjust your application code accordingly. Upgrade from Yii 2.0.40 ----------------------- * The methods `getAuthKey()` and `validateAuthKey()` of `yii\web\IdentityInterface` are now also used to validate active sessions (previously these methods were only used for cookie-based login). If your identity class does not properly implement these methods yet, you should update it accordingly (an example can be found in the guide under `Security` -> `Authentication`). Alternatively, you can simply return `null` in the `getAuthKey()` method to keep the old behavior (that is, no validation of active sessions). Applications that change the underlying `authKey` of an authenticated identity, should now call `yii\web\User::switchIdentity()`, `yii\web\User::login()` or `yii\web\User::logout()` to recreate the active session with the new `authKey`. Upgrade from Yii 2.0.39.3 ------------------------- * Priority of processing `yii\base\Arrayable`, and `JsonSerializable` data has been reversed (`Arrayable` data is checked first now) in `yii\base\Model`, and `yii\rest\Serializer`. If your application relies on the previous priority you need to fix it manually based on the complexity of desired (de)serialization result. Upgrade from Yii 2.0.38 ----------------------- * The storage structure of the file cache has been changed when you use `\yii\caching\FileCache::$keyPrefix`. It is worth warming up the cache again if there is a logical dependency when working with the file cache. * `yii\web\Session` now respects the 'session.use_strict_mode' ini directive. In case you use a custom `Session` class and have overwritten the `Session::openSession()` and/or `Session::writeSession()` functions changes might be required: * When in strict mode the `openSession()` function should check if the requested session id exists (and mark it for forced regeneration if not). For example, the `DbSession` does this at the beginning of the function as follows: ```php if ($this->getUseStrictMode()) { $id = $this->getId(); if (!$this->getReadQuery($id)->exists()) { //This session id does not exist, mark it for forced regeneration $this->_forceRegenerateId = $id; } } // ... normal function continues ... ``` * When in strict mode the `writeSession()` function should ignore writing the session under the old id. For example, the `DbSession` does this at the beginning of the function as follows: ```php if ($this->getUseStrictMode() && $id === $this->_forceRegenerateId) { //Ignore write when forceRegenerate is active for this id return true; } // ... normal function continues ... ``` > Note: The sample code above is specific for the `yii\web\DbSession` class. Make sure you use the correct implementation based on your parent class, e.g. `yii\web\CacheSession`, `yii\redis\Session`, `yii\mongodb\Session`, etc. > Note: In case your custom functions call their `parent` functions, there are probably no changes needed to your code if those parents implement the `useStrictMode` checks. > Warning: in case `openSession()` and/or `writeSession()` functions do not implement the `useStrictMode` code the session could be stored under a malicious id without warning even if `useStrictMode` is enabled. Upgrade from Yii 2.0.37 ----------------------- * Resolving DI references inside of arrays in dependencies was made optional and turned off by default. In order to turn it on, set `resolveArrays` of container instance to `true`. Upgrade from Yii 2.0.36 ----------------------- * `yii\db\Exception::getCode()` now returns full PDO code that is SQLSTATE string. If you have relied on comparing code with an integer value, adjust your code. Upgrade from Yii 2.0.35 ----------------------- * Inline validator signature has been updated with 4th parameter `current`: ```php /** * @param mixed $current the currently validated value of attribute */ function ($attribute, $params, $validator, $current) ``` * Behavior of inline validator used as a rule of `EachValidator` has been changed - `$attribute` now refers to original model's attribute and not its temporary counterpart: ```php public $array_attribute = ['first', 'second']; public function rules() { return [ ['array_attribute', 'each', 'rule' => ['customValidatingMethod']], ]; } public function customValidatingMethod($attribute, $params, $validator, $current) { // $attribute === 'array_attribute' (as before) // now: $this->$attribute === ['first', 'second'] (on every iteration) // previously: // $this->$attribute === 'first' (on first iteration) // $this->$attribute === 'second' (on second iteration) // use now $current instead // $current === 'first' (on first iteration) // $current === 'second' (on second iteration) } ``` * `$this` in an inline validator defined as closure now refers to model instance. If you need to access the object registering the validator, pass its instance through use statement: ```php $registrar = $this; $validator = function($attribute, $params, $validator, $current) use ($registrar) { // ... } ``` * Validator closure callbacks should not be declared as static. * If you have any controllers that override the `init()` method, make sure they are calling `parent::init()` at the beginning, as demonstrated in the [component guide](https://www.yiiframework.com/doc/guide/2.0/en/concept-components). You can find the upgrade notes for all versions online at: https://github.com/yiisoft/yii2/blob/2.0.41.1/framework/UPGRADE.md PS E:\wwwroot\github-shuijingwan-yii2-app-advanced>
3、先解决与 “fxp/composer-asset-plugin” 相关的提示信息。如图3
The "fxp/composer-asset-plugin" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
4、参考网址:https://www.yiiframework.com/doc/guide/2.0/zh-cn/structure-assets 。注意: 从 2.0.13 开始,基本和高级应用程序模板都默认配置使用 asset-packagist。决定全局删除 “fxp/composer-asset-plugin”。如图4
PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer global remove fxp/composer-asset-plugin Changed current directory to C:/Users/Administrator/AppData/Roaming/Composer The "fxp/composer-asset-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option. fxp/composer-asset-plugin is not required in your composer.json and has not been removed ./composer.json has been updated The "fxp/composer-asset-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option. Running composer update fxp/composer-asset-plugin Loading composer repositories with package information Updating dependencies Lock file operations: 0 installs, 0 updates, 1 removal - Removing fxp/composer-asset-plugin (v1.4.4) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 0 updates, 1 removal - Removing fxp/composer-asset-plugin (v1.4.4) Generating autoload files PS E:\wwwroot\github-shuijingwan-yii2-app-advanced>
5、再次运行 composer update 来更新 Yii 2 至最新版本,未再报错与 “fxp/composer-asset-plugin” 相关的提示信息。但是,仍然存在其他的提示信息。如图5
PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer update Loading composer repositories with package information Updating dependencies Nothing to modify in lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 0 updates, 0 removals Package flow/jsonpath is abandoned, you should avoid using it. Use softcreatr/jsonpath instead. Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Generating autoload files 47 packages you are using are looking for funding. Use the `composer fund` command to find out more!
6、包 flow/jsonpath 被放弃了,您应该避免使用它。请改用 softcreatr/jsonpath。决定卸载 flow/jsonpath ,安装 softcreatr/jsonpath。如图6
PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer remove flow/jsonpath ./composer.json has been updated Running composer update flow/jsonpath Loading composer repositories with package information Updating dependencies Lock file operations: 0 installs, 0 updates, 1 removal - Removing flow/jsonpath (0.5.0) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 0 updates, 1 removal - Removing flow/jsonpath (0.5.0) Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Generating autoload files 47 packages you are using are looking for funding. Use the `composer fund` command to find out more! PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer require --prefer-dist softcreatr/jsonpath Using version ^0.7.3 for softcreatr/jsonpath ./composer.json has been updated Running composer update softcreatr/jsonpath Loading composer repositories with package information Updating dependencies Lock file operations: 1 install, 0 updates, 0 removals - Locking softcreatr/jsonpath (0.7.3) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 1 install, 0 updates, 0 removals - Downloading softcreatr/jsonpath (0.7.3) - Installing softcreatr/jsonpath (0.7.3): Extracting archive Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Generating autoload files 48 packages you are using are looking for funding. Use the `composer fund` command to find out more! PS E:\wwwroot\github-shuijingwan-yii2-app-advanced>
7、软件包 phpunit/php-token-stream 被放弃了,您应该避免使用它。没有建议更换。使用 依赖性检测 depends 命令可以查出已安装在你项目中的某个包,是否正在被其它的包所依赖,并列出他们。得出结论:phpunit/php-code-coverage 依赖于 phpunit/php-token-stream,codeception/phpunit-wrapper、phpunit/phpunit 依赖于 phpunit/php-code-coverage,codeception/codeception、codeception/lib-asserts、codeception/verify 依赖于 codeception/phpunit-wrapper,层层依赖。决定保持此提示,暂时无解决方案。如图7
PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer depends phpunit/php-token-stream phpunit/php-code-coverage 7.0.14 requires phpunit/php-token-stream (^3.1.1 || ^4.0) PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer depends phpunit/php-code-coverage codeception/phpunit-wrapper 8.1.4 requires phpunit/php-code-coverage (^7.0) phpunit/phpunit 8.5.15 requires phpunit/php-code-coverage (^7.0.12) PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer depends codeception/phpunit-wrapper codeception/codeception 4.1.20 requires codeception/phpunit-wrapper (>6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.1.1 | ^9.0) codeception/lib-asserts 1.13.2 requires codeception/phpunit-wrapper (>6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.0.3 | ^9.0) codeception/verify 1.1.0 requires codeception/phpunit-wrapper (>6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.0.4) PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer depends codeception/codeception shuijingwan/yii2-app-advanced dev-master requires (for development) codeception/codeception (^4.0) codeception/lib-innerbrowser 1.4.2 requires codeception/codeception (*@dev) codeception/module-asserts 1.3.1 requires codeception/codeception (*@dev) codeception/module-filesystem 1.0.3 requires codeception/codeception (^4.0) codeception/module-yii2 1.1.2 requires codeception/codeception (^4.0) PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer depends phpunit/phpunit codeception/phpunit-wrapper 8.1.4 requires phpunit/phpunit (^8.0) codeception/stub 3.7.0 requires phpunit/phpunit (^8.4 | ^9.0) codeception/verify 1.1.0 requires phpunit/phpunit (> 6.0)
8、在线查看 Yii Framework 2.0 升级说明:https://github.com/yiisoft/yii2/blob/2.0.41.1/framework/UPGRADE.md ,了解可能不兼容的更改,比如,扩展了某些类,而这些类的属性与方法在新版本中有所调整。
1 条回复
[…] 上一篇 基于 Composer 更新 Yii 2 至最新版本,将 Yii Framework 从 2.0.35 版本升级到 2.0.41.1 […]