当--no-dev通过时,Composer失败了php版本

时间:2014-11-18 13:56:10

标签: php composer-php

我有一个具有dev-dependency的composer文件,需要PHP> = 5.4.0。当我更新生产(5.3安装(是的 - 我知道!))并显式传递--no-dev选项时,composer仍然会检查开发包中的PHP版本要求。

作曲家文件:

{
    "config": {
        "vendor-dir": "./vendor/"
    },
    "require": {
        "symfony/config" : "dev-master",
        "twig/twig": "1.15.1",
        "leafo/lessphp": "v0.4.0",
        "simplepie/simplepie": "dev-master",
        "contao/idna": "dev-master",
        "swiftmailer/swiftmailer": "5.3.*@dev",
        "james-heinrich/getid3": "dev-master",
        "pda/pheanstalk": "v2.1.0",
        "monolog/monolog": "1.9.1",
        "pimple/pimple": ">1.0.0",
        "doctrine/orm": "2.4.*",
        "ircmaxell/password-compat": "1.0.3",
        "raven/raven": "dev-curl-async",
        "elasticsearch/elasticsearch": "~1.0",
        "guzzle/guzzle": "3.9.2"
    },
    "require-dev": {
        "codeception/codeception": "2.1.*@dev"
    }
}

Codeception需要PHP 5.4.0+,当我运行composer update --no-dev时,我会得到以下内容:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for codeception/codeception 2.1.*@dev -> satisfiable by codeception/codeception[2.1.x-dev].
    - codeception/codeception 2.1.x-dev requires php >=5.4.0 -> no matching package found.

作曲家是否应该跳过包裹的要求检查我明确告诉它不要安装?我尝试过--ignore-platform-reqs但没有成功。

更新

似乎在PHP 5.3.10上运行它会完全忽略--no-dev选项并报告它正在安装它们:

composer update --no-dev
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for codeception/codeception 2.1.*@dev -> satisfiable by codeception/codeception[2.1.x-dev].
    - codeception/codeception 2.1.x-dev requires php >=5.4.0 -> no matching package found.

2 个答案:

答案 0 :(得分:0)

您需要使用--no-dev来安装开发包。

答案 1 :(得分:0)

<强>解决!!!

看来我的composer文件是一个bash脚本,没有正确地将参数传递给composer.phar文件。

这个问题是我自己创造的。