2016-08-01 106 views
2

我有一个已经运行了几年的现有Symfony + SonataAdmin项目。我想升级到SonataAdmin 3.x. 3.0将会是一个好的开始,然后一旦我们检查到所有的工作都会正常工作,然后升级到3.x。将Sonata从2.3升级到3.0

但是,我似乎无法获得一套可行的作曲家依赖关系升级。目前的设置包括:

"sonata-project/admin-bundle": "~2.3", 
    "sonata-project/core-bundle": "~2.3", 
    "sonata-project/doctrine-orm-admin-bundle": "~2.3", 
    "sonata-project/user-bundle": "[email protected]", 
    "sonata-project/datagrid-bundle": "[email protected]", 
    "friendsofsymfony/user-bundle": "~1.3", 

我试图改变最初的三到3.0 *,但我得到了以下错误:

$ composer update --dry-run

Loading composer repositories with package information

Updating dependencies (including require-dev)

Your requirements could not be resolved to an installable set of packages.

Problem 1

- sonata-project/user-bundle 2.x-dev requires sonata-project/core-bundle ~2.2 -> satisfiable by sonata-project/core-bundle[2.2.0-2.2.7, 2.3.0-2.3.11, 2.x-dev] but these conflict with your requirements or minimum-stability. 

- sonata-project/user-bundle 2.3.x-dev requires sonata-project/admin-bundle ~2.3|[email protected] -> satisfiable by sonata-project/admin-bundle[2.3.0-2.3.10, 2.x-dev] but these conflict with your requirements or minimum-stability. 

- Installation request for sonata-project/user-bundle [email protected] -> satisfiable by sonata-project/user-bundle[2.x-dev, 2.3.x-dev]. 

换款为用户捆绑的依赖性:

"sonata-project/user-bundle": "3.0.*@dev", 

3.0.*@dev,或3.0.0[email protected]

只是给出一个不同的错误:

$ composer update --dry-run

Loading composer repositories with package information

Updating dependencies (including require-dev)

[Composer\DependencyResolver\SolverProblemsException]

Problem 1 

    - The requested package sonata-project/user-bundle 3.0.* exists as sonata-project/user-bundle[2.3.x-dev, dev-master] but these are rejected by your constraint. 

最后,试图"sonata-project/user-bundle": "dev-master",给出了这样的错误:

$ composer update --dry-run

Loading composer repositories with package information

Updating dependencies (including require-dev)

Your requirements could not be resolved to an installable set of packages.

Problem 1

- sonata-project/user-bundle dev-master requires sonata-project/admin-bundle ^3.1 -> satisfiable by sonata-project/admin-bundle[3.1.0, 3.2.0, 3.3.0, 3.3.1, 3.3.2, 3.4.0, 3.x-dev] but these conflict with your requirements or minimum-stability. 

- sonata-project/user-bundle dev-master requires sonata-project/admin-bundle ^3.1 -> satisfiable by sonata-project/admin-bundle[3.1.0, 3.2.0, 3.3.0, 3.3.1, 3.3.2, 3.4.0, 3.x-dev] but these conflict with your requirements or minimum-stability. 

- Installation request for sonata-project/user-bundle dev-master -> satisfiable by sonata-project/user-bundle[dev-master]. 

所以...有没有的sonata-project/user-bundle任何版本,它与3.0兼容*版本。其他奏鸣曲包? Packagist似乎暗示有一个3.0.0版本的sonata-project/user-bundle,但是在尝试引用它时,我在我的作曲家语法中做了什么错误?

+0

为什么使用'3.0.0'?这不是很自由。尝试在所有地方使用'^ 3.0',也许?如果你真的想限制为'3.0.0'(但是因为'3.0'和'3.1'之间没有BC-中断,所以这是非常没用的IMO)。如果有的话,你会错过一些错误修正。 – greg0ire

+0

好的,前三个和'sonata-project/user-bundle:dev-master'使用'^ 3.0'来解决。但我还没有运行它来了解升级涉及多少痛苦!我只是想先从2.3 - > 3.0获得与3.something协同工作,然后从那里升级到最新的3.x。但也许最好直接去^ 3.0。 – caponica

+0

我真的这么认为。 – greg0ire

回答

1

规则来轻松实现你的目标:

  • 采用稳定版本,并只
  • 不约束自己太多,以后可以做到这一点。

这里是我的composer.json的摘录:

"sonata-project/admin-bundle": "^3.0", 
    "sonata-project/core-bundle": "^3.0", 
    "sonata-project/doctrine-orm-admin-bundle": "^3.0", 
    "sonata-project/notification-bundle": "^3.0", 
    "sonata-project/user-bundle": "^3.0", 

简洁美观。