Symfony REST:voryx / restgeneratorbundle安装失败,将./composer.json恢复为原始内容

时间:2016-04-07 17:06:28

标签: php json rest symfony composer-php

今天,我决定学习并自行设计在Symfony2中创建REST API。 我已使用此命令安装了composer

curl -sS https://getcomposer.org/installer | php

现在我正在使用此命令安装Voryx REST Generator Bundle

php composer.phar require voryx/restgeneratorbundle dev-master

我收到此错误

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of package

  Problem 1
    - Installation request for voryx/restgeneratorbundle dev-master -> s
le by voryx/restgeneratorbundle[dev-master].
    - voryx/restgeneratorbundle dev-master requires sensio/generator-bun
 -> satisfiable by sensio/generator-bundle[3.0.x-dev, v3.0.0, v3.0.1, v3
.0.3, v3.0.4, v3.0.5, v3.0.6] but these conflict with your requirements
um-stability
Installation failed, reverting ./composer.json to its original content.

这是捆绑包的github存储库

https://github.com/voryx/restgeneratorbundle

====== EDITTED ====== 这是composer.json文件

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/", "SymfonyStandard": "app/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.5.*",
        "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": "~3.0",
        "sensio/framework-extra-bundle": "~3.0",
        "incenteev/composer-parameter-handler": "~2.0"
    },
    "require-dev": {
        "sensio/generator-bundle": "~2.3"
    },
    "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": "2.5-dev"
        }
    }
}

请问出错了什么?

1 个答案:

答案 0 :(得分:2)

不要指定要安装的软件包(dev-master)的版本:只需让作业到Composer只需启动命令:

php composer.phar require voryx/restgeneratorbundle

并将安装适合您当前依赖项的版本(0.3.0)。

要安装sf3安装版本,请参考此处的doc:目前存在各种安装方式。使用composer,您只需运行命令:

php composer.phar create-project symfony/framework-standard-edition my_project_name

希望这个帮助