2014-02-06 86 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