2014-02-06 89 views
5

使用Symfony2,将nelmio/api-doc-bundle添加到我的composer.json中。我的文件就像Symfony作曲家更新“冻结”更新依赖关系

{ 
"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": "[email protected]", 
    "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" 
    } 
} 

}

但是当我运行作曲家更新,该脚本块更新的依赖。 Verbosing它,我可以看到,是这行冻结:

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

这是罚款之前,我加入nelmio/API-DOC束,但我有另一束同样的问题(我终于reseted项目)。


EDIT 02/07:当我做一个作曲家安装(与--prefer - 距离或--prefer源),I有这些错误:

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. 

编辑2:我降级我的Symfony到2.3〜,当我做一个更新,即冻结改变

Reading /root/.composer/cache/repo/https---packagist.org/provider-dflydev$markdown.json from cache 
+0

您确定2.4.5版本与您的其他软件包兼容吗? – Sehael

+0

你尝试过使用prefer-source/prefer-dist吗? 有关更多选项,请参阅: 'php composer.phar install --help' – nixoschu

+0

当我执行作曲家安装而不是更新时,出现以下错误: – maxime

回答

2

它的工作原理,尝试添加“最小稳定性”:“dev”作曲家。 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": "[email protected]", 
    "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" 
    } } } 
1

在Symfony2中的新版本的一些软件包是行已弃用或不再使用。你必须选择:

  • 如果要安装捆绑软件和更新的Symfony版本到一个新的改变compose.json文件的最新更新的一个,并在年底附加捆绑软件;最后运行你的composer.phar来更新Symfony并安装这个包。检查此链接为最新的JSON文件的Symfony(Symfony 2.4 composer.json
  • 如果你想安装的软件包,但保留目前所有的包如只是追加--prefer - 距离

    PHP作曲家更新 - prefer-dist