Composer:如何忽略某些依赖项的安装/更新?

时间:2018-06-27 23:43:20

标签: php composer-php

我在一个项目上,这是依赖关系列表

{
    "name": "my/package",
    "description": "My new project",
    "require": [
       "another/package": "1.0.0",
       //...
    ],
    "require-dev" => [
         "phpunit/phpunit": "~6.0",
         //....
    ]
}

another/package上,这是composer.json文件

{
    "name": "another/package",
    "description": "My new other project",
    "require-dev" => [
         "phpunit/phpunit": "~5.0",
         //....
    ]
}

another/package在版本<中也使用phpunit/phpunit,而不使用my/project中使用的版本。有可能会忽略在another/package中安装phpunit / phpunit吗?

1 个答案:

答案 0 :(得分:0)

你做不到。

Dependency Hell in Composer #2609

但是您可以try this technique

其他选项:

  1. 看看在我/项目中使用phpunit 5.0是否不是问题
  2. 查看是否存在另一个需要phpunit 6.0的版本/软件包