没有不值得去解决的问题,也没有不值得去学习的技术!

Resolving the “Package codeception/base is abandoned” Warning When Running composer update

When running composer update, the following prompt appears: Package codeception/base is abandoned, you should avoid using it. No replacement was suggested.

1. When running composer update, the following prompt appears: Package codeception/base is abandoned, you should avoid using it. No replacement was suggested., as shown in Figure 1

When running composer update, the following prompt appears: Package codeception/base is abandoned, you should avoid using it. No replacement was suggested.
Figure 1
Plaintext
PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
The "https://asset-packagist.org/p/provider-latest/5ef0dd267fe49b34e98cd105cacfd72ecd16b1c8f262edeecb0248316fe7ff50.json
" file could not be downloaded: failed to open stream: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试
失败。

https://asset-packagist.org could not be fully loaded, package information was loaded from the local cache and may be ou
t of date
Package operations: 1 install, 27 updates, 0 removals

Package codeception/base is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
19 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.31 to 2.0.35.

  Please check the upgrade notes for possible incompatible changes
  and adjust your application code accordingly.

2. Since I am using the Yii 2 advanced project template, I checked the composer.json on GitHub and found that it no longer depends on codeception/base. Reference: https://github.com/yiisoft/yii2-app-advanced/blob/2.0.35/composer.json , as shown in Figure 2

Since I am using the Yii 2 advanced project template, I checked the composer.json on GitHub and found that it no longer depends on codeception/base. Reference: https://github.com/yiisoft/yii2-app-advanced/blob/2.0.35/composer.json
Figure 2

3. In the local environment, composer.json still depends on codeception/base, as shown in Figure 3

In the local environment, composer.json still depends on codeception/base
Figure 3
Plaintext
    "require-dev": {
        "yiisoft/yii2-debug": "~2.0.0",
        "yiisoft/yii2-gii": "~2.0.0",
        "yiisoft/yii2-faker": "~2.0.0",
        "codeception/base": "^2.2.3",
        "codeception/verify": "~0.3.1"
    },

4. Modify the composer.json file to match the composer.json on GitHub

Plaintext
    "require-dev": {
        "yiisoft/yii2-debug": "~2.1.0",
        "yiisoft/yii2-gii": "~2.1.0",
        "yiisoft/yii2-faker": "~2.0.0",
        "codeception/codeception": "^4.0",
        "codeception/module-asserts": "^1.0",
        "codeception/module-yii2": "^1.0",
        "codeception/module-filesystem": "^1.0",
        "codeception/verify": "~0.5.0 || ~1.1.0",
        "symfony/browser-kit": ">=2.7 <=4.2.4"
    },

5. Run composer update again to update the development dependencies to the latest version. The prompt: Package codeception/base is abandoned, you should avoid using it. No replacement was suggested. has disappeared, as shown in Figure 4

Run composer update again to update the development dependencies to the latest version. The prompt: Package codeception/base is abandoned, you should avoid using it. No replacement was suggested. has disappeared.
Figure 4
Plaintext
PS E:\wwwroot\github-shuijingwan-yii2-app-advanced> composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 13 installs, 15 updates, 2 removals
  - Removing bower-asset/typeahead.js (v0.11.1)
  - Removing codeception/base (2.5.6)
  - Updating phpunit/php-code-coverage (6.1.4 => 7.0.10): Downloading (100%)
  - Installing sebastian/type (1.1.3): Downloading (100%)
  - Updating sebastian/global-state (2.0.0 => 3.0.0): Downloading (100%)
  - Updating phpunit/phpunit (7.5.20 => 8.5.5): Downloading (100%)
  - Updating codeception/phpunit-wrapper (7.8.0 => 8.1.2): Downloading (100%)
  - Updating codeception/verify (0.3.3 => 1.1.0): Loading from cache
  - Installing opis/closure (3.5.3): Downloading (100%)
  - Updating yiisoft/yii2-debug (2.0.14 => 2.1.13): Downloading (100%)
  - Updating yiisoft/yii2-gii (2.0.8 => 2.1.4): Downloading (100%)
  - Installing symfony/polyfill-intl-normalizer (v1.17.0): Downloading (100%)
  - Installing symfony/polyfill-intl-grapheme (v1.17.0): Downloading (100%)
  - Installing symfony/string (v5.1.0): Downloading (100%)
  - Updating symfony/console (v4.4.9 => v5.1.0): Downloading (100%)
  - Installing psr/event-dispatcher (1.0.0): Downloading (100%)
  - Updating symfony/event-dispatcher-contracts (v1.1.7 => v2.1.2): Downloading (100%)
  - Installing symfony/deprecation-contracts (v2.1.2): Downloading (100%)
  - Updating symfony/event-dispatcher (v4.4.9 => v5.1.0): Downloading (100%)
  - Updating symfony/yaml (v4.4.9 => v5.1.0): Downloading (100%)
  - Updating symfony/css-selector (v4.4.9 => v5.1.0): Downloading (100%)
  - Updating codeception/stub (2.1.0 => 3.6.1): Downloading (100%)
  - Updating symfony/finder (v4.4.9 => v5.1.0): Downloading (100%)
  - Installing codeception/lib-asserts (1.12.0): Downloading (100%)
  - Installing codeception/codeception (4.1.5): Downloading (100%)
  - Installing codeception/module-asserts (1.2.1): Downloading (100%)
  - Downgrading symfony/browser-kit (v4.4.9 => v4.2.4): Loading from cache
  - Installing codeception/lib-innerbrowser (1.3.1): Downloading (100%)
  - Installing codeception/module-yii2 (1.1.0): Downloading (100%)
  - Installing codeception/module-filesystem (1.0.2): Loading from cache
codeception/codeception suggests installing hoa/console (For interactive console functionality)
codeception/codeception suggests installing codeception/specify (BDD-style code blocks)
codeception/codeception suggests installing symfony/phpunit-bridge (For phpunit-bridge support)
codeception/codeception suggests installing stecman/symfony-console-completion (For BASH autocompletion)
Writing lock file
Generating autoload files
25 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系