SonataUserBundle要求Symfony 3.3出现问题

时间:2017-09-15 09:29:31

标签: symfony symfony-3.3 sonata-user-bundle

我试图用作曲家要求“sonata-project / user-bundle”,但得到以下错误:

- sonata-project/user-bundle 3.2.4 requires friendsofsymfony/user-bundle ^1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev, v1.3.0, v1.3.1, v1.3.2, v1.3.3, v1.3.4, v1.3.5, v1.3.6, v1.3.7] but these conflict with your requirements or minimum-stability.
- sonata-project/user-bundle 3.2.3 requires friendsofsymfony/user-bundle ^1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev, v1.3.0, v1.3.1, v1.3.2, v1.3.3, v1.3.4, v1.3.5, v1.3.6, v1.3.7] but these conflict with your requirements or minimum-stability.
- sonata-project/user-bundle 3.2.2 requires friendsofsymfony/user-bundle ^1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev, v1.3.0, v1.3.1, v1.3.2, v1.3.3, v1.3.4, v1.3.5, v1.3.6, v1.3.7] but these conflict with your requirements or minimum-stability.
- sonata-project/user-bundle 3.2.1 requires friendsofsymfony/user-bundle ^1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev, v1.3.0, v1.3.1, v1.3.2, v1.3.3, v1.3.4, v1.3.5, v1.3.6, v1.3.7] but these conflict with your requirements or minimum-stability.
- sonata-project/user-bundle 3.2.0 requires friendsofsymfony/user-bundle ^1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev, v1.3.0, v1.3.1, v1.3.2, v1.3.3, v1.3.4, v1.3.5, v1.3.6, v1.3.7] but these conflict with your requirements or minimum-stability.
- Installation request for sonata-project/user-bundle ^3.2 -> satisfiable by sonata-project/user-bundle[3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4].

我的composer.json需要部分:

"require": {
        "php": ">=7.0",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-migrations-bundle": "^1.0",
        "doctrine/orm": "^2.5",
        "friendsofsymfony/user-bundle": "~2.0",
        "gedmo/doctrine-extensions": "^2.4",
        "incenteev/composer-parameter-handler": "^2.0",
        "pixassociates/sortable-behavior-bundle": "^1.3",
        "sensio/distribution-bundle": "^5.0.19",
        "sensio/framework-extra-bundle": "^3.0.2",
        "sonata-project/admin-bundle": "^3.23",
        "sonata-project/doctrine-orm-admin-bundle": "^3.1",
        "sonata-project/easy-extends-bundle": "^2.2",
        "sonata-project/formatter-bundle": "^3.2",
        "stof/doctrine-extensions-bundle": "^1.2",
        "symfony/monolog-bundle": "^3.1.0",
        "symfony/polyfill-apcu": "^1.0",
        "symfony/security-bundle": "^3.3",
        "symfony/swiftmailer-bundle": "^2.3.10",
        "symfony/symfony": "3.3.*",
        "twig/twig": "^1.0||^2.0"
    },

实际上我不明白,为什么“sonata-project / user-bundle”需要“friendsofsymfony / user-bundle ^ 1.3”如果Symfony 2.8+仅支持“friendsofsymfony / user-bundle~2.0”。

那么我可以将Symfony 3.3与“sonata-project / user-bundle”一起使用吗?

2 个答案:

答案 0 :(得分:2)

你可以,但是你必须使用仍在开发中的SonataUserBundle的4.x分支(但已经相当稳定了):

  

" sonata-project / user-bundle":" dev-master",

有关packagist依赖关系的更多信息:https://packagist.org/packages/sonata-project/user-bundle

答案 1 :(得分:0)

是的,你应该使用

  "sonata-project/user-bundle": "dev-master",

你还必须改变

"config": {
    "platform": {
        "php": "7.0"
    },
    "sort-packages": true
},
在composer.json文件中

这肯定会有效