无法在 Symfony2 2.4 中安装 SonataUserBundle
Posted
技术标签:
【中文标题】无法在 Symfony2 2.4 中安装 SonataUserBundle【英文标题】:Unable to install SonataUserBundle in Symfony2 2.4 【发布时间】:2014-01-07 22:19:23 【问题描述】:我无法使用 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",
- composer update 运行顺利。
sonata-user [2.2.2] 与 Symfony2 2.4 不兼容吗?我找不到任何有关此的官方信息。
我检查了 composer.json od SonataUserBundle 和 SonataAdminBundle(我安装成功),并且都需要“symfony/http-foundation”:“~2.2”,所以我真的没有想法......
更新
github上的票
https://github.com/sonata-project/SonataUserBundle/issues/300#issuecomment-31214179
【问题讨论】:
对此有任何临时修复吗? 不...我刚刚从奏鸣曲用户包中辞职并编写了自己的用户类实现、用户管理员等...我在描述中添加了 github 票链接。希望它会在一段时间内提供解决方案。 【参考方案1】:通过修改composer.json来改变friendsofsymfony/user-bundle的版本 -
"friendsofsymfony/user-bundle": "1.3.3",
并发出命令:
composer update
在 Symfony 2.4.0 上为我工作
【讨论】:
我会在 14 年 1 月 6 日之后尝试。感谢您的回复。 我设法安装了它,谢谢。不幸的是,我不会在当前项目中使用它。已经实现了用户管理。但对未来有用。我希望版本 2.* 将很快与 sf2.4 + 兼容。 +1 我接受这个答案,因为目前 installine sonata user bundle 2.2* 似乎是不可能的,而您的解决方案是我发现安装 sonata user bundle 的唯一方法。 在 Symfony 2.6 上工作【参考方案2】:好消息!
我添加了一些修复以使 SonataUserBundle 与 FOSUserBundle 2.0* 一起使用
https://github.com/sonata-project/SonataUserBundle/pull/303
【讨论】:
我可以看到,不幸的是,它不会到达主人。但是感谢您的尝试。以上是关于无法在 Symfony2 2.4 中安装 SonataUserBundle的主要内容,如果未能解决你的问题,请参考以下文章
如何在 OS X Yosemite 上的 Apache 2.4 中安装 mod_perl 2.0.9?