通过composer安装多个版本的PHPUnit [英] Install multiple version of PHPUnit via composer

查看:146
本文介绍了通过composer安装多个版本的PHPUnit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ZendFramework 1.x & 2.x,很遗憾,ZendFramework 1.x仅支持PHPUnit 3.x& Zend Framework 2.x需要PHPUnit 4.x

I am working with ZendFramework 1.x & 2.x, unfortunately ZendFramework 1.x supports only PHPUnit 3.x & Zend Framework 2.x requires PHPUnit 4.x

为此,我要安装2个版本的PHPUnit,这是我尝试过的composer.json文件.

For this i want to install 2 versions of PHPUnit, here is the composer.json file i tried.

{
    "repositories": [{
        "type": "pear",
        "url": "http://pear.symfony-project.com"
    },{
        "type": "pear",
        "url": "http://pear.phpunit.de"
    }],
    "require-dev": {
        "pear-pear.phpunit.de/PHPUnit": "3.4.*",
        "phpunit/phpunit": "*"
    }
}

我收到以下消息.

针对软件包phpunit/phpunit的bin phpunit的跳过安装:名称 与现有文件冲突

Skipped installation of bin phpunit for package phpunit/phpunit: name conflicts with an existing file

无论如何,我可以告诉作曲家在vendor/bin目录中安装时使用不同的名称吗?例如"pear-pear.phpunit.de/PHPUnit": "3.4.*"使用vendor/bin/pu34& "phpunit/phpunit": "*"使用vendor/bin/pu

Is there anyway that i can tell composer to use different names when installing in vendor/bin directory? for instance "pear-pear.phpunit.de/PHPUnit": "3.4.*" uses vendor/bin/pu34 & "phpunit/phpunit": "*" uses vendor/bin/pu

有可能在作曲家中做到这一点吗?

is it possible to do this in composer?

推荐答案

Composer不支持安装多个同一软件包的版本.

Composer does not support installing multiple versions of the same package.

您唯一可以做的就是将一个(或两个)安装为 phar .但随后它们将不会在composer.json中定义.

The only thing you could do is install one (or both of them) as phar. But then they will not be defined in the composer.json.

这篇关于通过composer安装多个版本的PHPUnit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆