douhuang5331
2017-09-28 13:14
浏览 63
已采纳

phpunit 5.6.4在php 5.6中无法通过composer进行doctrine的依赖

I have a problem composer install dependencies. We use php which is version 5.6.24. When installing phpunit 5.6.4, we install doctrine needs php^7. This is our partial composer.lock after require and install phpunit.

"packages-dev": [
    {
        "name": "doctrine/instantiator",
        "version": "1.1.0",
        "source": {
            "type": "git",
            "url": "https://github.com/doctrine/instantiator.git",
            "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
        },
        "dist": {
            "type": "zip",
            "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
            "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
            "shasum": ""
        },
        "require": {
            "php": "^7.1"
        },

Why does it cause and How do we fix this dependency from php 7 to 5? As I thought, It is possible of using phpunit 5.6.4 in php 5 as https://packagist.org/packages/phpunit/phpunit#5.6.4 show. (We use cakephp 2.10.3 depending on sebastian/exporter 1.2. So we can use only under 5.6.4 phpunit version.)

and we use docker ,so we install library following command .

docker run --rm -it -v $(pwd):/app composer:1.4.1 require --dev phpunit/phpunit:"5.6.4" --ignore-platform-reqs --update-with-dependencies 

图片转代码服务由CSDN问答提供 功能建议

我在编写器安装依赖项时遇到问题。 我们使用的是版本5.6.24的php。 当安装phpunit 5.6时 .4,我们安装doctrine需要php ^ 7。 这是我们在require和install phpunit之后的部分composer.lock。

 “packages-dev”:[
 {
“name”:“doctrine / instantiator”,\  n“version”:“1.1.0”,
“source”:{
“type”:“git”,
“url”:“https://github.com/doctrine/instantiator.git”,  
“引用”:“185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda”
},
“dist”:{
“type”:“zip”,
“url”:“https://api.github.com/repos/doctrine  / instantiator / zipball / 185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda“,
”reference“:”185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda“,
”shasum“:”“
},
”require“:{
”php“:”^ 7.1“
}  ,
   
 
 

为什么它会导致我们如何修复从php 7到5的这种依赖? 我想,有可能在php 5中使用phpunit 5.6.4作为 https: //packagist.org/packages/phpunit/phpunit#5.6.4 显示。 (我们使用cakephp 2.10.3取决于sebastian / exporter 1.2。所以我们只能使用5.6.4 phpunit版本。)

我们使用docker,所以我们按照命令安装库。

  docker run --rm -it -v $(pwd):/ app composer:1.4.1 require --dev phpunit / phpunit:“5.6.4” -  ignore-platform-reqs --update-with-dependencies 
   
 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题