更新 symfony2 作曲家引发错误

Updating symfony2 composer raise errors

当我尝试 运行 命令时 php composer.phar update 它引发了这些错误:

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

  Problem 1
    - sonata-project/admin-bundle dev-master requires sensio/generator-    bundle ~2.3 -> no matching package found.
    - sonata-project/admin-bundle dev-master requires sensio/generator-    bundle ~2.3 -> no matching package found.
    - Installation request for sonata-project/admin-bundle dev-master ->  satisfiable by sonata-project/admin-bundle[dev-master].

这是我的composer.json数据:

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": {
            "": "src/",
            "Mobyt":  "vendor/mobyt/mobyt/src/",
            "EE":     "vendor/ee/dataexporter-bundle/"
        }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.2.*",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.2.*",
        "symfony/monolog-bundle": "2.2.*",
        "sensio/distribution-bundle": "2.2.*",
        "sensio/framework-extra-bundle": "2.2.*",
        "sensio/generator-bundle": "2.2.*",
        "jms/security-extra-bundle": "1.4.*",
        "jms/di-extra-bundle": "1.3.*",
        "symfony/console": "2.2.*@dev",
        "doctrine/doctrine-fixtures-bundle": "dev-master",
        "doctrine/data-fixtures" : "dev-master",
        "friendsofsymfony/user-bundle": "*",
        "doctrine/doctrine-migrations-bundle": "dev-master",
        "doctrine/migrations": "dev-master",
        "sonata-project/admin-bundle": "dev-master",
        "sonata-project/doctrine-orm-admin-bundle": "dev-master",
        "sonata-project/intl-bundle": "2.1.*",
        "sonata-project/cache-bundle": "2.*",
        "sonata-project/block-bundle": "dev-master",
        "sonata-project/easy-extends-bundle": "2.1.*",
        "sonata-project/doctrine-extensions": "1.*",
        "stof/doctrine-extensions-bundle": "~1.1@dev",
        "friendsofsymfony/jsrouting-bundle": "~1.1",
        "friendsofsymfony/advanced-encoder-bundle": "dev-master",
        "knplabs/knp-menu-bundle":"1.1.x-dev",
        "jms/serializer": "dev-master",
        "sonata-project/user-bundle": "2.2.*@dev"
    },
    "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"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "alpha",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "branch-alias": {
            "dev-master": "2.2-dev"
        }
    }
}

如何解决此作曲家更新问题?

您使用的是 Symfony2 的过时版本:2.2. The dev-master branch of sonata-project/admin-bundle requires the ~2.3 version of sensio/generator-bundle which is not available with Symfony 2.2. You should try the 2.2.x-dev 版本需要 2.2 版本的 sensio/generator-bundle。所以你必须编辑你的 composer.json 文件并替换:

"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",

有:

"sonata-project/admin-bundle": "2.2.*",
"sonata-project/doctrine-orm-admin-bundle": "2.2.*",