我想将项目从Symfony 2.3升级到2.4。我已经明白2.4版本与2.3版本具有向后兼容性,并且只需要更新de组件版本。升级Symfony2 2.3到2.4:更改composer.json
这是我composer.json:
{
"name" : "symfony/framework-standard-edition",
"description" : "The \"Symfony Standard Edition\" distribution",
"type" : "project",
"license" : [
"MIT"
],
"require" : {
"symfony/symfony" : "2.3.*",
"doctrine/doctrine-fixtures-bundle" : "dev-master",
"symfony/swiftmailer-bundle" : "2.3.*",
"doctrine/orm" : ">=2.2.3,<2.4-dev",
"doctrine/data-fixtures" : "dev-master",
"symfony/assetic-bundle" : "2.3.*",
"incenteev/composer-parameter-handler" : "~2.0",
"twig/extensions" : "1.0.*",
"php" : ">=5.3.3",
"sensio/generator-bundle" : "2.3.*",
"symfony/monolog-bundle" : "2.4.*",
"sensio/framework-extra-bundle" : "2.3.*",
"doctrine/doctrine-bundle" : "1.2.*",
"sensio/distribution-bundle" : "2.3.*",
"liip/imagine-bundle": "dev-master",
"egeloen/google-map-bundle": "*"
},
"autoload" : {
"psr-0" : {
"" : "src/"
}
},
"minimum-stability" : "stable",
"config" : {
"bin-dir" : "bin"
},
"scripts" : {
"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"
],
"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"
]
},
"extra" : {
"branch-alias" : {
"dev-master" : "2.3-dev"
},
"symfony-web-dir" : "web",
"symfony-app-dir" : "app",
"incenteev-parameters" : {
"file" : "app/config/parameters.yml"
}
}
}
但是当我检查the v2.4 composer.json file是从这个非常不同。
我试着改变我的2.4版本的composer.json,添加我的自定义包并做一个“作曲家更新”,但它没有奏效。
是否足以在我自己的composer.json上更新安装2.4版本的捆绑软件的版本?
谢谢。
有了这个composer.json,更新已经完成。我只需添加我的自定义包和“doctrine/data-fixtures”+“doctrine/doctrine-fixtures-bundle”。谢谢。 – lenko
不客气。下面的@hanzi也给出了github上symfony-standard-editin的[composer.json](https://github.com/symfony/symfony-standard/blob/2.4/composer.json)文件的链接,我给了它在我的例子中。 –