Upgrading Symfony to Version 3.0 - Bad Distribution Version

I am trying to upgrade from Symfony 2.7 to 3.0. I made my code without obsolete and updated composer.json with new versions of packages according to this one . When I start the update using the command: composer update --with-dependencies symfony/symfony , this gives me an error, as follows:

 Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package sensio/distribution-bundle == 4.0.4.0 could not be found. Problem 2 - The requested package sensio/generator-bundle == 2.5.3.0 could not be found. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details. Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. 

I do not know where these strange versions of these two packages come from. My composer.json looks like this:

 { "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.*", "twig/extensions": "~1.0", "symfony/assetic-bundle": "~2.3", "symfony/swiftmailer-bundle": "~2.3", "symfony/monolog-bundle": "~2.8", "sensio/distribution-bundle": "~5.0", "sensio/framework-extra-bundle": "~3.0.2", "incenteev/composer-parameter-handler": "~2.0" }, "require-dev": { "sensio/generator-bundle": "~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.0-dev" }, "symfony-assets-install": "symlink" } } 

I don’t see where I made a mistake, any suggestions?

Edit:

Running only composer update instead of composer update --with-dependencies symfony/symfony seems to solve the problem, all packages are updated successfully, after which it shows:

 [RuntimeException] An error occurred when executing the "'cache:clear --no-warmup'" command: Fatal error: Class 'Symfony\Component\Console\Input\ArgvInput' not found in /home/wombat/htdocs/gugupanel/app/console on line 17 
+5
source share
2 answers

Here is the .json composer, which almost matches yours, which works for me.

 { "name": "symfony/framework-standard-edition", "license": "MIT", "type": "project", "description": "The \"Symfony Standard Edition\" distribution", "autoload": { "psr-4": { "": "src/" }, "files": [ "app/AppKernel.php" ] }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "require": { "php": ">=5.5.9", "symfony/symfony": "3.0.*", "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", "sensio/distribution-bundle": "^5.0", "sensio/framework-extra-bundle": "^3.0.2", "incenteev/composer-parameter-handler": "^2.0", "phpunit/phpunit": "^4.8", "sensio/generator-bundle": "^3.0" }, "require-dev": { "symfony/phpunit-bridge": "^2.7" }, "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" ] }, "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.0-dev" } } } 
+2
source

To fix such problems with the composer, I recommend removing the library from the .json composer and then using the composer.

  • Remove the "sensio/distribution-bundle": "~5.0" dependency "sensio/distribution-bundle": "~5.0"
  • Run composer update
  • Still a mistake? Repeat 1 and 2 with other libraries that cause errors.
  • No mistake? Now, you, the composer, need the libraries you removed:

    composer needs sensio / distribution-bundle transmission

Thus, the composer will find the best costumes for you. It is also useful to maintain a more stable json composer!

Remember to commit your composer.lock file after all the updates are great, so that other developers will use the same versions as you.

Hope this helps!

+1
source

Source: https://habr.com/ru/post/1239075/


All Articles