Symfony 3.3 的 SonataUserBundle 需求问题

SonataUserBundle requirements problems with Symfony 3.3

我正在尝试使用作曲家要求 "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" 一起使用吗?

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

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

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

是的,你应该使用

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

你还必须改变

"config": {
    "platform": {
        "php": "7.0"
    },
    "sort-packages": true
},

在 composer.json 文件中这肯定有效