Symfony 更新 2.8 到 3.4

Posted

技术标签:

【中文标题】Symfony 更新 2.8 到 3.4【英文标题】:Symfony Update 2.8 to 3.4 【发布时间】:2018-09-29 17:59:19 【问题描述】:

我想将我的旧 Symfony 项目从 2.8 升级到 4.0,但我在从 2.8 升级到 3.4 时堆积如山。我用这个教程升级Moving to Symfony 3.4。

我在尝试通过 composer Composer Upgrade Errors 更新时遇到一些错误:

# php composer.phar update symfony/symfony --with-dependencies
Dependency "symfony/polyfill-apcu" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "twig/twig" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "ircmaxell/password-compat" is also a root requirement, but is not explicitly whitelisted. Ignoring.
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
    - The requested package symfony/monolog-bundle (installed at v2.12.1, required as ^3.1.0) is satisfiable by symfony/monolog-bundle[v2.12.1] but these conflict with your requirements or minimum-stability.
  Problem 2
    - The requested package sensio/distribution-bundle (installed at v3.0.36, required as ^5.0.19) is satisfiable by sensio/distribution-bundle[v3.0.36] but these conflict with your requirements or minimum-stability.
  Problem 3
    - The requested package sensio/framework-extra-bundle (installed at v3.0.29, required as ^5.0.0) is satisfiable by sensio/framework-extra-bundle[v3.0.29] but these conflict with your requirements or minimum-stability.
  Problem 4
    - The requested package sensio/generator-bundle (installed at v2.5.3, required as ^3.0) is satisfiable by sensio/generator-bundle[v2.5.3] but these conflict with your requirements or minimum-stability.
  Problem 5
    - Conclusion: don't install symfony/symfony v3.4.8
    - Conclusion: don't install symfony/symfony v3.4.7
    - Conclusion: don't install symfony/symfony v3.4.6
    - Conclusion: don't install symfony/symfony v3.4.5
    - Conclusion: don't install symfony/symfony v3.4.4
    - Conclusion: don't install symfony/symfony v3.4.3
    - Conclusion: don't install symfony/symfony v3.4.2
    - Conclusion: don't install symfony/symfony v3.4.1
    - Conclusion: don't install symfony/symfony v3.4.0
    - Conclusion: don't install symfony/symfony v3.3.16
    - Conclusion: don't install symfony/symfony v3.3.15
    - Conclusion: don't install symfony/symfony v3.3.14
    - Conclusion: don't install symfony/symfony v3.3.13
    - Conclusion: don't install symfony/symfony v3.3.12
    - Conclusion: don't install symfony/symfony v3.3.11
    - Conclusion: don't install symfony/symfony v3.3.10
    - Conclusion: don't install symfony/symfony v3.3.9
    - Conclusion: don't install symfony/symfony v3.3.8
    - Conclusion: don't install symfony/symfony v3.3.7
    - Conclusion: don't install symfony/symfony v3.3.6
    - Conclusion: don't install symfony/symfony v3.3.5
    - Conclusion: don't install symfony/symfony v3.3.4
    - Conclusion: don't install symfony/symfony v3.3.3
    - Conclusion: don't install symfony/symfony v3.3.2
    - Conclusion: don't install symfony/symfony v3.3.1
    - Conclusion: don't install symfony/symfony v3.3.0
    - Conclusion: don't install symfony/symfony v3.2.14
    - Conclusion: don't install symfony/symfony v3.2.13
    - Conclusion: don't install symfony/symfony v3.2.12
    - Conclusion: don't install symfony/symfony v3.2.11
    - Conclusion: don't install symfony/symfony v3.2.10
    - Conclusion: don't install symfony/symfony v3.2.9
    - Conclusion: don't install symfony/symfony v3.2.8
    - Conclusion: don't install symfony/symfony v3.2.7
    - Conclusion: don't install symfony/symfony v3.2.6
    - Conclusion: don't install symfony/symfony v3.2.5
    - Conclusion: don't install symfony/symfony v3.2.4
    - Conclusion: don't install symfony/symfony v3.2.3
    - Conclusion: don't install symfony/symfony v3.2.2
    - Conclusion: don't install symfony/symfony v3.2.1
    - Conclusion: don't install symfony/symfony v3.2.0
    - Conclusion: don't install symfony/symfony v3.1.10
    - Conclusion: don't install symfony/symfony v3.1.9
    - Conclusion: don't install symfony/symfony v3.1.8
    - Conclusion: don't install symfony/symfony v3.1.7
    - Conclusion: don't install symfony/symfony v3.1.6
    - Conclusion: don't install symfony/symfony v3.1.5
    - Conclusion: don't install symfony/symfony v3.1.4
    - Conclusion: don't install symfony/symfony v3.1.3
    - Conclusion: don't install symfony/symfony v3.1.2
    - Conclusion: don't install symfony/symfony v3.1.1
    - Conclusion: don't install symfony/symfony v3.1.0
    - Conclusion: don't install symfony/symfony v3.0.9
    - Conclusion: don't install symfony/symfony v3.0.8
    - Conclusion: don't install symfony/symfony v3.0.7
    - Conclusion: don't install symfony/symfony v3.0.6
    - Conclusion: don't install symfony/symfony v3.0.5
    - Conclusion: don't install symfony/symfony v3.0.4
    - Conclusion: don't install symfony/symfony v3.0.3
    - Conclusion: don't install symfony/symfony v3.0.2
    - Installation request for guzzle/guzzle (installed at v3.9.3) -> satisfiable by guzzle/guzzle[v3.9.3].
    - Conclusion: don't install symfony/symfony v3.0.1
    - sensio/framework-extra-bundle v5.1.6 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.5 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.4 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.3 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.2 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.1 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.0 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.0.1 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.0.0 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - symfony/http-kernel v3.3.0 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.1 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.10 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.11 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.12 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.13 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.14 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.15 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.16 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.2 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.3 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.4 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.5 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.6 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.7 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.8 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.9 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.0 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.1 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.2 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.3 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.4 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.5 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.6 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.7 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.8 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.0 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.1 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.2 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.3 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.4 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.5 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.6 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.7 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.8 conflicts with symfony/symfony[v3.0.0].
    - Installation request for symfony/symfony ~3.0 -> satisfiable by symfony/symfony[v3.0.0, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.0.8, v3.0.9, v3.1.0, v3.1.1, v3.1.10, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6, v3.1.7, v3.1.8, v3.1.9, v3.2.0, v3.2.1, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.14, v3.2.2, v3.2.3, v3.2.4, v3.2.5, v3.2.6, v3.2.7, v3.2.8, v3.2.9, v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8].
    - Installation request for sensio/framework-extra-bundle ^5.0.0 -> satisfiable by sensio/framework-extra-bundle[v5.0.0, v5.0.1, v5.1.0, v5.1.1, v5.1.2, v5.1.3, v5.1.4, v5.1.5, v5.1.6].

这是我以前的composer.json:


    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "minimum-stability": "stable",
    "autoload": 
        "psr-0": 
            "": "src/",
            "SymfonyStandard": "app/"
        
    ,
    "require": 
        "php": ">=5.3.3",
        "symfony/symfony": "2.8.*",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "~1.2",
        "twig/extensions": "~1.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~3.0",
        "sensio/framework-extra-bundle": "~3.0",
        "incenteev/composer-parameter-handler": "~2.0",
        "facebook/php-sdk-v4": "^5.0",
        "google/apiclient": "1.0.*@beta",
        "ircmaxell/password-compat": "~1.0",
        "symfony/filesystem": "~2.6",
        "symfony/dom-crawler": "~2.6",
        "symfony/yaml": "~2.6",
        "symfony/serializer": "~2.6",
        "omnipay/payu": "^2.0@dev",
        "omnipay/paypal": "^2.5"
    ,
    "require-dev": 
        "sensio/generator-bundle": "~2.3"
    ,
    "scripts": 
        "post-root-package-install": [
            "SymfonyStandard\\Composer::hookRootPackageInstall"
        ],
        "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::removeSymfonyStandardFiles"
        ],
        "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::removeSymfonyStandardFiles"
        ]
    ,
    "config": 
        "bin-dir": "bin"
    ,
    "extra": 
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": 
            "file": "app/config/parameters.yml"
        ,
        "branch-alias": 
            "dev-master": "2.5-dev"
        
    

这是我的新composer.json:


    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": 
        "psr-0": 
            "": "src/",
            "SymfonyStandard": "app/"
        
    ,
    "require": 
        "php": ">=5.5.9",
        "symfony/symfony": "~3.0",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "twig/twig": "^1.0||^2.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "^2.6.4",
        "symfony/monolog-bundle": "^3.1.0",
        "sensio/distribution-bundle": "^5.0.19",
        "sensio/framework-extra-bundle": "^5.0.0",
        "incenteev/composer-parameter-handler": "^2.0",
        "symfony/polyfill-apcu": "^1.0",
        "facebook/php-sdk-v4": "^5.0",
        "google/apiclient": "1.0.*@beta",
        "ircmaxell/password-compat": "~1.0",
        "symfony/filesystem": "~2.6",
        "symfony/dom-crawler": "~2.6",
        "symfony/yaml": "~2.6",
        "symfony/serializer": "~2.6",
        "omnipay/payu": "^2.0@dev",
        "omnipay/paypal": "^2.5"
    ,
    "require-dev": 
        "sensio/generator-bundle": "^3.0",
        "symfony/phpunit-bridge": "^3.0"
    ,
    "scripts": 
        "post-root-package-install": [
            "SymfonyStandard\\Composer::hookRootPackageInstall"
        ],
        "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::removeSymfonyStandardFiles"
        ],
        "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::removeSymfonyStandardFiles"
        ]
    ,
    "config": 
        "bin-dir": "bin"
    ,
    "extra": 
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": 
            "file": "app/config/parameters.yml"
        ,
        "branch-alias": 
            "dev-master": "3.4-dev"
        
    

说实话,上一次我在 3 年前在 Symfony 中做某事时,但我真的很想要我的旧项目。如果有人可以帮助我找出问题所在。

我已经尝试将 minimum-stability:stable 更改为 minimum-stability:dev,但没有成功。

【问题讨论】:

您是否尝试手动将提及的依赖项更新为所需版本? 手动你的意思是在json文件里面?是的,我做到了。也许我应该尝试使用作曲家来更新它? 像这样使用作曲家composer require symfony/monolog-bundle:^3.1.0 您好,我尝试这样做,但在 require sensio/framework-extra-bundle:^5.0.0require sensio/symfony 上也存在一些问题: ^3.4.*。来自TUTORIAL 的其他人都可以。 你可以用composer require手动解决每一个新问题,不要太多 【参考方案1】:

升级到 3.4.*,因为它是最新的 LTS 版本。 4.4 出来时应该更新到版本 4(它将是 LTS 版本)。

尝试调整您的配置,如下所示并运行作曲家更新。以下配置带有自动装配。考虑是否要使用它,但我建议,因为使用类型提示在构造函数中获取服务/控制器中的依赖项会更舒服。

1) Composer.json

"symfony/symfony": "3.4.*",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^5.0.0",
"twig/twig": "^1.0||^2.0",
"symfony/monolog-bundle": "^3.1.0",

2) app/config/services.yml

services:
    _defaults:
        autowire: true # Automatically injects dependencies in your services
        autoconfigure: true
        public: false
        bind:
            # Nice feature here. Local Binding. Read about it at documentation.


    # makes classes in AppBundle available to be used as services
    AppBundle\:
        resource: '../../src/AppBundle/*'
    # exclude directories || files (if service is unused, it will be removed anyway)
        exclude: '../../src/AppBundle/Entity,Repository,Tests'
    AppBundle\Controller\:
        resource: '../../src/AppBundle/Controller'
        public: true
        tags: ['controller.service_arguments']

3) AppBundle/Resources/config/services.yml

   services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: false

【讨论】:

感谢您的回答。今晚我试试:) 谢谢,它帮助了我。我需要在 composer.json 中做更多的调整并且更新了 :) 现在我需要修复一些代码问题。非常感谢:) 我很高兴,它帮助了你。 :)

以上是关于Symfony 更新 2.8 到 3.4的主要内容,如果未能解决你的问题,请参考以下文章

Symfony 2.8 -> 3.4 本地开发速度降低

将 symfony 2.8 更新到 3.* ,奏鸣曲错误

自 Symfony2 更新到 2.8 以来覆盖注册表单(SonataUserBundle)

从 Symfony 3.4 升级到 4:升级 symfony 时出错

Symfony 2.8:ResourceInterface::isFresh() 自 2.8 起已弃用

Symfony 2.8 动态 ChoiceType 选项