-1

I have a problem with the migration from Symfony 2.8 to Symfony 3 and higher. I’ve been trying to update my project for a few days, but I’m blocking the same mistakes. I tried all the solutions I could find on google but no evolutions. Here is my file composer.json

{
"name": "My/project",
"license": "proprietary",
"type": "project",
"autoload": {
    "psr-4": {
        "": "src/"
    },
    "classmap": [
        "app/AppKernel.php",
        "app/AppCache.php"
    ]
},
"require": {
    "php": ">=5.3.9",
    "symfony/symfony": "3.0.*",
    "doctrine/orm": "^2.5",
    "doctrine/doctrine-bundle": "^1.6",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "~2.0",
    "sonata-project/admin-bundle": "3.13",
    "sonata-project/doctrine-orm-admin-bundle": "^3.1",
    "friendsofsymfony/user-bundle": "^1.3",
    "sonata-project/core-bundle": "^3.1",
    "sonata-project/easy-extends-bundle": "^2.1",
    "sonata-project/user-bundle": "^3.2",
    "sonata-project/formatter-bundle": "^3.1",
    "knplabs/knp-paginator-bundle": "^2.5",
    "sonata-project/intl-bundle": "^2.3",
    "google/recaptcha": "^1.1",
    "twig/twig": "1.28.2",
    "friendsofsymfony/jsrouting-bundle": "^1.6",
    "helios-ag/fm-elfinder-bundle": "^6.2",
    "vich/uploader-bundle": "1.5.3",
    "beberlei/doctrineextensions": "^1.0",
    "simplethings/entity-audit-bundle": "^1.0",
    "sentry/sentry-symfony": "^1.0",
    "rollbar/rollbar": "~1.1",
    "mikey179/vfsstream": "^1.6"
},
"require-dev": {
    "sensio/generator-bundle": "~3.0",
    "doctrine/doctrine-fixtures-bundle": "^2.3",
    "hautelook/alice-bundle": "^2.0@beta",
    "nelmio/alice": "^3.0@beta",
    "theofidry/alice-data-fixtures": "^1.0@beta",
    "symfony/phpunit-bridge": "^4.2",
    "phpunit/phpunit": "^6.1",
    "behat/behat": "^3.4",
    "behat/mink": "^1.7",
    "behat/mink-selenium2-driver": "^1.3",
    "behat/symfony2-extension": "^2.1",
    "behat/mink-extension": "^2.2",
    "behat/mink-browserkit-driver": "^1.3",
    "behat/mink-goutte-driver": "^1.2",
    "emuse/behat-html-formatter": "^0.1.0",
    "phing/phing": "2.*"
},
"scripts": {
    "symfony-scripts": [
        "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-install-cmd": [
        "@symfony-scripts"
    ],
    "post-update-cmd": [
        "@symfony-scripts"
    ]
},
"config": {
    "component-dir": "web/assets"
},
"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"
    }
}

}

I use this command to update : $ composer update symfony/symfony --with-dependencies --no-scripts

update is not done because apparently I have conflicts with different versions of my dependencies..yet I can’t update my dependencies in a more recent version

enter image description here

Need your help please..

AlexisCraig
  • 526
  • 4
  • 20

1 Answers1

0

You have a conflict because you cannot have symfony/symfony 3.0.* and symfony/cache 3.4 at the same time.

In fact, other bundles that you have locked at a version are not compatible with symfony 3.0, so you need to bump them up as well.

The minimum viable would be to use these dependencies :

"symfony/symfony": "3.2.*",
"friendsofsymfony/user-bundle": "^2.0",
"sonata-project/user-bundle": "^4.0",

Then just run composer install instead of composer update symfony/symfony. Composer will do its job, and then you'll have to adapt your code to mitigate all the BC breaks, etc ...

If you cannot change your other dependencies, then you're stuck with Sf 2.8.

tchap
  • 3,412
  • 3
  • 29
  • 46