2
votes

I'm trying to upgrade from 2.1 to 2.3 but getting composer error:

Your requirements could not be resolved to an installable set of packages.

I tried to upgrade just the framework first without bundles by replacing "symfony/symfony": "2.1." with "symfony/symfony": "2.3." in composer.json and running php composer.phar update symfony/symfony
it didn't work so I tried to update jms/security-extra-bundle first, but it didn't work

php composer.phar update

didn't work neither, I teied "symfony/symfony": "2.2.*" as well

here my composer.json, what should I change?

{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "psr-0": { "": "src/" }
},
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.1.*",
    "doctrine/orm": ">=2.2.3,<2.4-dev",
    "doctrine/doctrine-bundle": "1.0.*",
    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.1.*",
    "symfony/swiftmailer-bundle": "2.1.*",
    "symfony/monolog-bundle": "2.1.*",
    "sensio/distribution-bundle": "2.1.*",
    "sensio/framework-extra-bundle": "2.1.*",
    "sensio/generator-bundle": "2.1.*",
    "jms/security-extra-bundle": "dev-master",
    "jms/di-extra-bundle": "dev-master",
    "jms/serializer-bundle": "dev-master",
    "friendsofsymfony/user-bundle": "*",
    "vich/geographical-bundle": "*",
    "doctrine/doctrine-fixtures-bundle": "dev-master",
    "friendsofsymfony/rest-bundle": "*",
    "friendsofsymfony/comment-bundle": "*",
    "friendsofsymfony/jsrouting-bundle": "1.0.3",
    "servergrove/shell-alias-bundle": "dev-master",
    "beberlei/DoctrineExtensions": "dev-master",
    "stof/doctrine-extensions-bundle": "dev-master"
},
"scripts": {
    "post-install-cmd": [
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
    ],
    "post-update-cmd": [
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
    ]
},
"minimum-stability": "dev",
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "symfony-assets-install":"symlink"
}

}

1
You can compare your file to the reference composer.json file of Symfony 2.3. Symfony 2.3 requires "doctrine/doctrine-bundle": "1.2.*", but your file only provides `"doctrine/doctrine-bundle": "1.0.*"``. It may be the source of the error. So try to update your file with the reference Symfony 2.3 file.A.L
thanks, I was actually thinking of this but found a wrong file, will test tomorrowjeff

1 Answers

3
votes

Change the version constraints for the following packages to 2.3:

  • symfony/symfony
  • doctrine/doctrine-bundle
  • symfony/assetic-bundle
  • symfony/swiftmailer-bundle
  • symfony/monolog-bundle
  • sensio/distribution-bundle
  • sensio/framework-extra-bundle
  • sensio/generator-bundle

And the other packages as such

  • friendsofsymfony/jsrouting-bundle: 1.5.*

You'll also need to add the following packages:

  • incenteev/composer-parameter-handler

The post-install-cmd and post-update-cmd arrays would then need as the first command

"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",

A config.bin-dir definition should be provided for vendor executables

"config": {
    "bin-dir": "bin"
},

Since Symfony 2.3 is an LTS version (Long Term Support), you can either change the minimum-stability setting to stable or prefer stable packages if they are available

"prefer-stable": true,

So your composer.json file should look like this:

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.3.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.3.*",
        "symfony/swiftmailer-bundle": "2.3.*",
        "symfony/monolog-bundle": "2.3.*",
        "sensio/distribution-bundle": "2.3.*",
        "sensio/framework-extra-bundle": "2.3.*",
        "sensio/generator-bundle": "2.3.*",
        "incenteev/composer-parameter-handler": "~2.0",

        "jms/security-extra-bundle": "dev-master",
        "jms/di-extra-bundle": "dev-master",
        "jms/serializer-bundle": "dev-master",
        "friendsofsymfony/user-bundle": "*",
        "vich/geographical-bundle": "*",
        "doctrine/doctrine-fixtures-bundle": "dev-master",
        "friendsofsymfony/rest-bundle": "*",
        "friendsofsymfony/comment-bundle": "*",
        "friendsofsymfony/jsrouting-bundle": "1.5.*",
        "servergrove/shell-alias-bundle": "dev-master",
        "beberlei/DoctrineExtensions": "dev-master",
        "stof/doctrine-extensions-bundle": "dev-master"
    },
    "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"
        ],
        "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"
        ]
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "symfony-assets-install": "symlink"
    }
}