您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
composer降级(为了安装dbunit)
发布时间:2021-09-26 21:10:29编辑:雪饮阅读()
由于要用phpunit/dbunit,目前最高是4.0版本,但是其要求phpunit必须是7系列的,但是我的phpunit是9系列的。
那么这样直接运行如:
C:\Users\Administrator\PhpstormProjects\untitled>composer require --dev phpunit/dbunit
Using version ^4.0 for phpunit/dbunit
./composer.json has been updated
Running composer update phpunit/dbunit
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires phpunit/dbunit ^4.0 -> satisfiable by phpunit/dbunit[4.0.0].
- phpunit/dbunit 4.0.0 requires phpunit/phpunit ^7.0 -> found phpunit/phpunit[7.0.0, ..., 7.5.20] but it conflicts with your root composer.json require (9).
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
就会提示这些错误,不过这个错误中也提到了关键的一步,就是--with-all-dependencies,用这个选项就可以实现为了我们的phpunit/dbunit,则phpunit它就会强制被降级安装的。
C:\Users\Administrator\PhpstormProjects\untitled>composer --with-all-dependencies require --dev phpunit/dbunit
Using version ^4.0 for phpunit/dbunit
./composer.json has been updated
Running composer update phpunit/dbunit --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 18 updates, 1 removal
- Removing sebastian/type (2.3.4)
- Upgrading phpdocumentor/type-resolver (1.4.0 => 1.5.0)
- Locking phpunit/dbunit (4.0.0)
- Downgrading phpunit/php-code-coverage (8.0.2 => 6.1.4)
- Downgrading phpunit/php-file-iterator (3.0.5 => 2.0.4)
- Downgrading phpunit/php-text-template (2.0.4 => 1.2.1)
- Downgrading phpunit/php-timer (3.1.4 => 2.1.3)
- Downgrading phpunit/php-token-stream (4.0.4 => 3.1.3)
…………………………………………………………………………………………………
…………………………………………………………………………………………………..
…………………………………………………………………………………………………..
- Downgrading phpunit/php-token-stream (4.0.4 => 3.1.3): Extracting archive
- Downgrading phpunit/php-code-coverage (8.0.2 => 6.1.4): Extracting archive
- Downgrading phpunit/phpunit (9.0.0 => 7.5.20): Extracting archive
- Installing phpunit/dbunit (4.0.0): Extracting archive
1 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package phpunit/dbunit is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
18 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
关键字词:composer,dbunit