【发布时间】:2015-12-23 17:40:29
【问题描述】:
我正在尝试从 symfony 2.7 升级到 3.0。根据one,我使我的代码免于弃用并使用新的软件包版本更新composer.json。当我使用命令开始升级时:composer update --with-dependencies symfony/symfony 它给了我如下错误:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package sensio/distribution-bundle == 4.0.4.0 could not be found.
Problem 2
- The requested package sensio/generator-bundle == 2.5.3.0 could not be 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.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
我不知道这两个软件包的这些奇怪版本是从哪里来的。我的composer.json 看起来像:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.0.*",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.8",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "~3.0.2",
"incenteev/composer-parameter-handler": "~2.0"
},
"require-dev": {
"sensio/generator-bundle": "~3.0"
},
"scripts": {
"post-root-package-install": [
"SymfonyStandard\\Composer::hookRootPackageInstall"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
],
"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",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "3.0-dev"
},
"symfony-assets-install": "symlink"
}
}
我看不到哪里出错了,有什么建议吗?
编辑:
只执行composer update 而不是composer update --with-dependencies symfony/symfony 似乎可以解决问题,所有包更新成功,然后显示:
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
Fatal error: Class 'Symfony\Component\Console\Input\ArgvInput' not found in /home/wombat/htdocs/gugupanel/app/console on line 17
【问题讨论】:
-
对 sensio 库使用 ^ 而不是 ~。懒得查找差异,但它们为我安装干净,这就是 S3 composer.json 使用的。准备好有很多很多的形式问题。先去2.8可能会更好。
-
@Cerad - 将 ~ 更改为 ^ 没有任何区别,同样的错误。
标签: php composer-php symfony