2016-08-01 167 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", 

簡潔美觀。