我无法使用symfony2 2.4安装sonata-project / user-bundle。 Composer给了我这样的错误信息:
Problem 1
- Conclusion: remove symfony/symfony v2.4.0
- Installation request for symfony/framework-standard-edition 2.4.x-dev -> satisfiable by symfony/framework-standard-edition[2.4.x-dev].
- Conclusion: don't install symfony/symfony v2.4.0
- Installation request for sonata-project/user-bundle 2.2.2 -> satisfiable by sonata-project/user-bundle[2.2.2].
- Installation request for friendsofsymfony/user-bundle ~2.0@dev -> satisfiable by friendsofsymfony/user-bundle[2.0.x-dev].
- symfony/framework-standard-edition 2.4.x-dev requires sensio/framework-extra-bundle ~3.0 -> satisfiable by sensio/framework-extra-bundle[v3.0.0].
- sensio/framework-extra-bundle v3.0.0 requires symfony/framework-bundle ~2.4 -> satisfiable by symfony/symfony[v2.4.0], symfony/framework-bundle[v2.4.0].
- sensio/framework-extra-bundle v3.0.0 requires symfony/framework-bundle ~2.4 -> satisfiable by symfony/symfony[v2.4.0], symfony/framework-bundle[v2.4.0].
- Conclusion: don't install symfony/framework-bundle v2.4.0
我的composer.json:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.*",
"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",
"friendsofsymfony/user-bundle": "~2.0@dev",
"stof/doctrine-extensions-bundle": "~1.1@dev",
"sonata-project/admin-bundle": "~2.1",
"sonata-project/doctrine-orm-admin-bundle": "~2.1",
"sonata-project/user-bundle": "2.2.2",
"knplabs/knp-paginator-bundle": "2.3.*",
"knplabs/knp-menu-bundle": "1.1.*",
"knplabs/knp-menu": "1.1.*"
},
"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"
}
}
}
当我从composer.json中删除行"sonata-project/user-bundle": "2.2.2",
时 - 编辑器更新运行顺利。
奏鸣曲用户[2.2.2]与Symfony2 2.4不兼容吗?我找不到任何官方信息。
我chceck composer.json od SonataUserBundle和SonataAdminBundle(我成功安装),都需要“symfony / http-foundation”:“~2.2”,所以我真的没有想法......
更新
github中的票证
https://github.com/sonata-project/SonataUserBundle/issues/300#issuecomment-31214179
答案 0 :(得分:7)
通过修改composer.json更改 friendsofsymfony / user-bundle 的版本 -
"friendsofsymfony/user-bundle": "1.3.3",
并发出命令:
composer update
在Symfony 2.4.0上为我工作
答案 1 :(得分:2)
我添加了修复程序,以使SonataUserBundle与FOSUserBundle 2.0 *一起使用