我正在尝试从Symfony 5.2升级到Symfony 5.3。
我不知道要更新Symfony的哪个包,所以我使用了官方网站,我遵循了这两个包:
https://symfony.com/doc/current/setup/upgrade_major.html
还有https://symfony.com/doc/current/setup/upgrade_minor.html它说要更新:
"require": {
- "symfony/cache": "4.3.*",
+ "symfony/cache": "4.4.*",
- "symfony/config": "4.3.*",
+ "symfony/config": "4.4.*",
- "symfony/console": "4.3.*",
+ "symfony/console": "4.4.*",
和我得到相同的编辑器错误
运行的一些命令:
composer update "symfony/*" --with-all-dependencies
composer update
和'Updating Recipes'部分,更新了所有需要的内容。
错误保持不变:
>composer update
Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "5.3.*"
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/web-profiler-bundle[v5.3.0-BETA1, ..., 5.3.x-dev] require symfony/framework-bundle ^5.3 -> found symfony/framework-bundle[v5.3.0-BETA1, ..., 5.4.x-dev] but it conflicts with your root composer.json require (5.2.*).
- Root composer.json requires symfony/web-profiler-bundle ^5.2 -> satisfiable by symfony/web-profiler-bundle[v5.3.0-BETA1, ..., 5.3.x-dev].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
composer.json
{
"type": "project",
"license": "proprietary",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.2.5",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "1.11.99.1",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.3",
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.8",
"guzzlehttp/guzzle": "^7.3",
"phpdocumentor/reflection-docblock": "^5.2",
"sensio/framework-extra-bundle": "^6.1",
"symfony/apache-pack": "^1.0",
"symfony/asset": "5.2.*",
"symfony/console": "5.3.*",
"symfony/dotenv": "5.2.*",
"symfony/expression-language": "5.2.*",
"symfony/flex": "^1.3.1",
"symfony/form": "5.2.*",
"symfony/framework-bundle": "5.2.*",
"symfony/http-client": "5.2.*",
"symfony/intl": "5.2.*",
"symfony/mailer": "5.2.*",
"symfony/mime": "5.2.*",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "5.2.*",
"symfony/process": "5.2.*",
"symfony/property-access": "5.2.*",
"symfony/property-info": "5.2.*",
"symfony/proxy-manager-bridge": "5.2.*",
"symfony/rate-limiter": "5.2.*",
"symfony/security-bundle": "5.2.*",
"symfony/sendgrid-mailer": "5.3.*",
"symfony/serializer": "5.2.*",
"symfony/string": "5.2.*",
"symfony/translation": "5.2.*",
"symfony/twig-bundle": "^5.3",
"symfony/validator": "5.2.*",
"symfony/web-link": "5.2.*",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/yaml": "5.2.*",
"symfonycasts/reset-password-bundle": "^1.6",
"symfonycasts/verify-email-bundle": "^1.3",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
},
"require-dev": {
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"symfony/debug-bundle": "^5.3",
"symfony/maker-bundle": "^1.30",
"symfony/phpunit-bridge": "^5.2",
"symfony/stopwatch": "^5.2",
"symfony/var-dumper": "^5.2",
"symfony/web-profiler-bundle": "^5.2"
},
"config": {
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\Tests\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.3.*"
}
}
}
您有冲突的需求。
在extra.symfony.require
上,你说你想要5.3.*
。
但是在您的个人Symfony要求中,您指定^5.2
或5.2.*
(在某些情况下也指定^5.3
)。
当一个项目使用Symfony Flex时(就像你的情况一样),extra.symfony.require
的存在将用于限制许多/大多数Symfony软件包安装的软件包版本。但前提是你没有在require
节中声明一个特定的版本。
在这种情况下,您已经在extra.symfony.require
的5.*
范围上指定了一个版本。就这样,把*
作为require
部分中所有其他Symfony包的版本约束。
(注意,它不是真正的全部),因为有些包不是由Flex管理的,只是更新那些有版本声明在5.*
范围)