2014-01-14 101 views
2

我試圖從升級到2.1 2.3,但得到的作曲家錯誤:升級symfony的2.1至2.3 composer.json

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

我想先升級只是框架無束通過更換「的symfony/symfony的」 :「2.1。」與「symfony/symfony」:「2.3。」在composer.json中運行 php composer.phar更新symfony/symfony
它沒有工作,所以我試圖更新jms/security-extra - 捆綁第一,但它沒有工作

php composer.phar update 

也沒有工作,我也teied「symfony/symfony」:「2.2。*」以及

這裏我的composer.json,我應該改變什麼?

{ 
"name": "symfony/framework-standard-edition", 
"description": "The \"Symfony Standard Edition\" distribution", 
"autoload": { 
    "psr-0": { "": "src/" } 
}, 
"require": { 
    "php": ">=5.3.3", 
    "symfony/symfony": "2.1.*", 
    "doctrine/orm": ">=2.2.3,<2.4-dev", 
    "doctrine/doctrine-bundle": "1.0.*", 
    "twig/extensions": "1.0.*", 
    "symfony/assetic-bundle": "2.1.*", 
    "symfony/swiftmailer-bundle": "2.1.*", 
    "symfony/monolog-bundle": "2.1.*", 
    "sensio/distribution-bundle": "2.1.*", 
    "sensio/framework-extra-bundle": "2.1.*", 
    "sensio/generator-bundle": "2.1.*", 
    "jms/security-extra-bundle": "dev-master", 
    "jms/di-extra-bundle": "dev-master", 
    "jms/serializer-bundle": "dev-master", 
    "friendsofsymfony/user-bundle": "*", 
    "vich/geographical-bundle": "*", 
    "doctrine/doctrine-fixtures-bundle": "dev-master", 
    "friendsofsymfony/rest-bundle": "*", 
    "friendsofsymfony/comment-bundle": "*", 
    "friendsofsymfony/jsrouting-bundle": "1.0.3", 
    "servergrove/shell-alias-bundle": "dev-master", 
    "beberlei/DoctrineExtensions": "dev-master", 
    "stof/doctrine-extensions-bundle": "dev-master" 
}, 
"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" 
    ] 
}, 
"minimum-stability": "dev", 
"extra": { 
    "symfony-app-dir": "app", 
    "symfony-web-dir": "web", 
    "symfony-assets-install":"symlink" 
} 

}

+1

您可以將您的文件進行比較(https://github.com/symfony/symfony-standard/blob/2.3/composer參考[Symfony的2.3 composer.json文件]以.json)。 Symfony 2.3需要''doctrine/doctrine-bundle「:」1.2。*「',但是你的文件只提供'」doctrine/doctrine-bundle「:」1.0。*「''。這可能是錯誤的根源。所以試着用參考Symfony 2.3文件來更新你的文件。 –

+0

謝謝,我其實是在想這個,但是發現一個錯誤的文件,明天會測試 – jeff

回答

3

更改版本約束以下軟件包2.3:

  • 的symfony/symfony的
  • 學說/教義束
  • 的symfony/assetic束
  • symfony/swiftmailer-bundles
  • 的symfony /獨白束
  • SENSIO /分佈束
  • SENSIO /框架 - 超束
  • SENSIO /發電機束

而其它軟件包作爲這樣

  • friendsofsymfony/jsrouting-bundle:1.5。*

您還需要添加以下軟件包:

  • incenteev /作曲家參數處理程序然後

post-install-cmdpost-update-cmd陣列將需要作爲第一命令

"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 

config.bin-dir定義應爲供應商提供可執行文件

"config": { 
    "bin-dir": "bin" 
}, 

由於Symfony的2.3是一個LTS版本(長期支持),您可以更改minimum-stability設置stable或喜歡穩定的軟件包(如果可用)

"prefer-stable": true, 

所以你的作曲家。JSON文件應該是這樣的:

{ 
    "name": "symfony/framework-standard-edition", 
    "description": "The \"Symfony Standard Edition\" distribution", 
    "autoload": { 
     "psr-0": { "": "src/" } 
    }, 
    "require": { 
     "php": ">=5.3.3", 
     "symfony/symfony": "2.3.*", 
     "doctrine/orm": ">=2.2.3,<2.4-dev", 
     "doctrine/doctrine-bundle": "1.2.*", 
     "twig/extensions": "1.0.*", 
     "symfony/assetic-bundle": "2.3.*", 
     "symfony/swiftmailer-bundle": "2.3.*", 
     "symfony/monolog-bundle": "2.3.*", 
     "sensio/distribution-bundle": "2.3.*", 
     "sensio/framework-extra-bundle": "2.3.*", 
     "sensio/generator-bundle": "2.3.*", 
     "incenteev/composer-parameter-handler": "~2.0", 

     "jms/security-extra-bundle": "dev-master", 
     "jms/di-extra-bundle": "dev-master", 
     "jms/serializer-bundle": "dev-master", 
     "friendsofsymfony/user-bundle": "*", 
     "vich/geographical-bundle": "*", 
     "doctrine/doctrine-fixtures-bundle": "dev-master", 
     "friendsofsymfony/rest-bundle": "*", 
     "friendsofsymfony/comment-bundle": "*", 
     "friendsofsymfony/jsrouting-bundle": "1.5.*", 
     "servergrove/shell-alias-bundle": "dev-master", 
     "beberlei/DoctrineExtensions": "dev-master", 
     "stof/doctrine-extensions-bundle": "dev-master" 
    }, 
    "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" 
     ] 
    }, 
    "minimum-stability": "dev", 
    "prefer-stable": true, 
    "config": { 
     "bin-dir": "bin" 
    }, 
    "extra": { 
     "symfony-app-dir": "app", 
     "symfony-web-dir": "web", 
     "symfony-assets-install": "symlink" 
    } 
} 
+0

非常感謝,我明天會測試一下 – jeff