2016-05-31 101 views
3

所以我用Symfony 2.8.6开发了这个博客。我注意到Symfony3.1 LTS 版本可用并希望升级。因此,我修复了所有的弃用呼叫。将Symfony从2.8升级到3.1:“您的需求无法解析为可安装的一组软件包。”

我抓住Symfony3.1的composer.json文件,并试图运行

$ composer update 

然而,更新失败,我得到下面的输出:

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 
    - phpunit/phpunit 5.3.4 requires phpspec/prophecy ^1.3.1 -> satisfiable by phpspec/prophecy[v1.6.0, 1.4.0, v1.3.1, v1.4.1, v1.5.0]. 
    - phpunit/phpunit 5.3.0 requires phpspec/prophecy ^1.3.1 -> satisfiable by phpspec/prophecy[v1.6.0, 1.4.0, v1.3.1, v1.4.1, v1.5.0]. 
    - phpunit/phpunit 5.3.1 requires phpspec/prophecy ^1.3.1 -> satisfiable by phpspec/prophecy[v1.6.0, 1.4.0, v1.3.1, v1.4.1, v1.5.0]. 
    - phpunit/phpunit 5.3.2 requires phpspec/prophecy ^1.3.1 -> satisfiable by phpspec/prophecy[v1.6.0, 1.4.0, v1.3.1, v1.4.1, v1.5.0]. 
    - phpunit/phpunit 5.3.3 requires phpspec/prophecy ^1.3.1 -> satisfiable by phpspec/prophecy[v1.6.0, 1.4.0, v1.3.1, v1.4.1, v1.5.0]. 
    - phpunit/phpunit 5.3.4 requires phpspec/prophecy ^1.3.1 -> satisfiable by phpspec/prophecy[v1.6.0, 1.4.0, v1.3.1, v1.4.1, v1.5.0]. 
    - phpspec/prophecy v1.6.0 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.4, 2.0.0, 2.0.1, 2.0.2, 2.0.3]. 
    - phpspec/prophecy 1.4.0 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.4, 2.0.0, 2.0.1, 2.0.2, 2.0.3]. 
    - phpspec/prophecy v1.3.1 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.4, 2.0.0, 2.0.1, 2.0.2, 2.0.3]. 
    - phpspec/prophecy v1.4.1 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.4, 2.0.0, 2.0.1, 2.0.2, 2.0.3]. 
    - phpspec/prophecy v1.5.0 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.4, 2.0.0, 2.0.1, 2.0.2, 2.0.3]. 
    - phpspec/prophecy v1.6.0 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.4, 2.0.0, 2.0.1, 2.0.2, 2.0.3]. 
    - phpdocumentor/reflection-docblock 2.0.0 conflicts with symfony/symfony[v3.1.0]. 
    - phpdocumentor/reflection-docblock 2.0.1 conflicts with symfony/symfony[v3.1.0]. 
    - phpdocumentor/reflection-docblock 2.0.2 conflicts with symfony/symfony[v3.1.0]. 
    - phpdocumentor/reflection-docblock 2.0.3 conflicts with symfony/symfony[v3.1.0]. 
    - phpdocumentor/reflection-docblock 2.0.4 conflicts with symfony/symfony[v3.1.0]. 
    - symfony/symfony v3.1.0 conflicts with phpdocumentor/reflection-docblock[2.0.4]. 
    - Installation request for symfony/symfony 3.1.* -> satisfiable by symfony/symfony[v3.1.0]. 
    - Installation request for phpunit/phpunit 5.3.* -> satisfiable by phpunit/phpunit[5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.4]. 

这是我composer.json

{ 
    "name": "symfony/framework-standard-edition", 
    "license": "MIT", 
    "type": "project", 
    "description": "The \"Symfony Standard Edition\" distribution", 
    "autoload": { 
     "psr-4": { "": "src/" }, 
     "classmap": [ "app/AppKernel.php", "app/AppCache.php" ] 
    }, 
    "autoload-dev": { 
     "psr-4": { "Tests\\": "tests/" } 
    }, 
    "require": { 
     "php": ">=5.5.9", 
     "symfony/symfony": "3.1.*", 
     "doctrine/orm": "^2.5", 
     "doctrine/doctrine-bundle": "^1.6", 
     "doctrine/doctrine-cache-bundle": "^1.2", 
     "symfony/swiftmailer-bundle": "^2.3", 
     "symfony/monolog-bundle": "^2.8", 
     "symfony/polyfill-apcu": "^1.0", 
     "sensio/distribution-bundle": "^5.0", 
     "sensio/framework-extra-bundle": "^3.0.2", 
     "incenteev/composer-parameter-handler": "^2.0", 
     "symfony/assetic-bundle": "^2.7", 
     "knplabs/knp-time-bundle": "^1.6", 
     "eko/feedbundle": "^1.2", 
     "friendsofsymfony/user-bundle": "dev-master", 
     "lexik/maintenance-bundle": "dev-master", 
     "phpunit/phpunit": "5.3.*" 
    }, 
    "require-dev": { 
     "sensio/generator-bundle": "^3.0", 
     "symfony/phpunit-bridge": "^3.0" 
    }, 
    "scripts": { 
     "post-install-cmd": [ 
      "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 
     ], 
     "post-update-cmd": [ 
      "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 
     ] 
    }, 
    "config": { 
     "bin-dir": "bin", 
     "platform": { 
      "php": "5.6.16" 
     } 
    }, 
    "extra": { 
     "symfony-app-dir": "app", 
     "symfony-bin-dir": "bin", 
     "symfony-var-dir": "var", 
     "symfony-web-dir": "web", 
     "symfony-tests-dir": "tests", 
     "symfony-assets-install": "relative", 
     "incenteev-parameters": { 
      "file": "app/config/parameters.yml" 
     }, 
     "branch-alias": { 
      "dev-master": "3.1-dev" 
     } 
    } 
} 

我也尝试在runn时添加--with-dependencies选项ing composer update但无济于事。

有谁知道哪个包是冲突的?

+0

只是想指出的是,3.1是不是一个长期释放。每六个月会有一次发布。下一个LTS将在2017年11月发布。http://symfony.com/roadmap?version=3.4#checker通过一切手段升级,但要确​​保您正确升级。 – Cerad

+0

@Cerad:哦,我的天哪,你是对的!你认为我应该坚持2.8呢? – D4V1D

+0

这当然完全取决于你和你的应用程序。 – Cerad

回答

1

这是由于a conflict between Symfony 3.1 and phpdocumentor/reflection-docblock: <3.0(由PHPUnit的要求),这是在composer.json文件中声明:

"conflict": { 
    "phpdocumentor/reflection-docblock": "<3.0" 
}, 

来源:https://github.com/symfony/symfony/blob/b004243cb31059f9a97c0a1a045c2dbd1a77dee8/composer.json#L92

您有几种解决方案:

+0

是的!我刚刚看到了!我因此升级到3.0,等待冲突得到解决。谢谢! – D4V1D

相关问题