我是一个旧的Symfony项目,这里是composer.json
:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": {"": "src/"}
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "*",
"symfony/console": ">=2.2.3",
"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",
"facebook/php-sdk-v4" : "4.0.*",
"symfony/finder": "^3.1",
"sonata-project/core-bundle": "^3.1",
"sonata-project/seo-bundle": "^2.0",
"sonata-project/admin-bundle": "^3.6"
},
"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"
}
} }
首先我要使用:
php composer.phar self-update
然后我用下面的命令升级:
php composer.phar update
结果如下:
Search for a package: symfony
Found 15 packages matching symfony
[0] symfony/symfony [1] rgies/symfony [2] php-tmdb/symfony [3] webforge/symfony [4] lexpress/symfony1 [5] symfony/symfony1 [6] sabaki-dev/symfony1 [7] behat/symfony2-extension [8] escapestudios/symfony2-coding-standard [9] smarkio/symfony1 [10] languara/symfony3 [11] m6web/symfony2-coding-standard [12] irongit/symfony2-stream-response [13] polishsymfonycommunity/symfony2-mocker-extension [14] symfony/console
Enter package # to add, or the complete package name if it is not listed: 0
Enter the version constraint to require (or leave blank to use the latest version):
Using version ^3.1 for symfony/symfony
Search for a package: ./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install symfony/symfony v3.1.6
- Conclusion: don't install symfony/symfony v3.1.5
- Conclusion: don't install symfony/symfony v3.1.4
- Conclusion: don't install symfony/symfony v3.1.3
- Installation request for sensio/generator-bundle (locked at v2.5.3, required as ~2.3) -> satisfiable by sensio/generator-bundle[v2.5.3].
- Conclusion: don't install symfony/symfony v3.1.2
- Conclusion: don't install symfony/symfony v3.1.1
- don't install symfony/finder v3.1.6|don't install symfony/symfony v3.1.0
- don't install symfony/symfony v3.1.0|remove symfony/finder v3.1.6
- don't install symfony/symfony v3.1.0|don't install symfony/finder v3.1.6
- Installation request for symfony/symfony ^3.1 -> satisfiable by symfony/symfony[v3.1.0, v3.1.1, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6].
- Installation request for symfony/finder (locked at v3.1.6, required as ^3.1) -> satisfiable by symfony/finder[v3.1.6], symfony/symfony[v3.1.6].
Installation failed, reverting ./composer.json to its original content.
答案 0 :(得分:1)
我使用php composer.phar self-update
完成,然后php composer.phar update
成功更改为symfony 2.8