6

With Symfony2, added the nelmio/api-doc-bundle to my composer.json. My file is like

{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "psr-0": { "": "src/" }
},
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "~2.4",
    "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": "~2.3",
    "sensio/framework-extra-bundle": "~3.0",
    "sensio/generator-bundle": "~2.3",
    "incenteev/composer-parameter-handler": "~2.0",
    "jms/serializer-bundle" : "0.13.0",
    "friendsofsymfony/rest-bundle": "1.2.2",
    "friendsofsymfony/user-bundle": "~2.0@dev",
    "coresphere/console-bundle": "dev-master",
    "nelmio/api-doc-bundle": "2.4.5"
},
"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"
    ]
},
"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.4-dev"
    }
}

}

But when i run composer update, the script blocks updating dependencies. Verbosing it, I can see that is this line which freezes:

Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$cg.json from cache

It was fine before I added nelmio/api-doc-bundle, but I had the same problem with another bundle (and I finally reseted the project).


EDIT 02/07: When I do a composer install (with --prefer-dist or --prefer-source), I have these errors:

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



Problem 1
    - The requested package friendsofsymfony/rest-bundle could not be found in any version, there may be a typo in the package name.
  Problem 2
    - The requested package jms/serializer-bundle could not be found in any version, there may be a typo in the package name.
  Problem 3
    - Installation request for symfony/framework-standard-edition 2.4.x-dev -> satisfiable by symfony/framework-standard-edition[2.4.x-dev].
    - symfony/framework-standard-edition 2.4.x-dev requires jms/serializer-bundle 0.13.0 -> no matching package 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.

EDIT 2 : I downgraded my Symfony to ~2.3, and when I do an update, the line that freezes changed

Reading /root/.composer/cache/repo/https---packagist.org/provider-dflydev$markdown.json from cache
3
  • are you sure that version 2.4.5 is compatible with your other bundles?
    – Sehael
    Feb 6, 2014 at 16:26
  • did you try to use prefer-source / prefer-dist ? For more options see : php composer.phar install --help
    – nixoschu
    Feb 6, 2014 at 21:23
  • When I do a composer install instead of an update, I have these errors:
    – maxime
    Feb 7, 2014 at 8:33

2 Answers 2

2

It works,Try adding "minimum-stability": "dev" to composer. google groups from phar error

{ "name": "symfony/framework-standard-edition", "license": "MIT", "type": "project", "description": "The \"Symfony Standard Edition\" distribution", "autoload": {
    "psr-0": { "": "src/" } }, "require": {
    "php": ">=5.3.3",
    "symfony/symfony": "~2.4",
    "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": "~2.3",
    "sensio/framework-extra-bundle": "~3.0",
    "sensio/generator-bundle": "~2.3",
    "incenteev/composer-parameter-handler": "~2.0",
    "jms/serializer-bundle" : "0.13.0",
    "friendsofsymfony/rest-bundle": "1.2.2",
    "friendsofsymfony/user-bundle": "~2.0@dev",
    "coresphere/console-bundle": "dev-master",
    "nelmio/api-doc-bundle": "2.4.5" }, "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"
    ] }, "config": {
    "bin-dir": "bin" }, "minimum-stability": "dev", "extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.4-dev"
    } } }
0

In new versions of Symfony2 some bundles are deprecated or not used anymore. You have to options:

  • If you want to install your bundle and update the Symfony version to a new one change the compose.json file to the latest updated one and at the end append your bundle; finally run your composer.phar to update Symfony and install the bundle. Check this link for the latest json file for Symfony (Symfony 2.4 composer.json)
  • If you want to install your bundle but keep all current bundles as is just append --prefer-dist:

    php composer update --prefer-dist

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.