0

我想在我的 Symfony2.2 项目中使用yvoyer/CalendarBundle 。

我将它添加到composer.json并运行:

composer update star/calendar-bundle --prefer-source

它返回此错误:

$ composer update star/calendar-bundle --prefer-source
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
    - Conclusion: remove symfony/symfony v2.2.0
    - star/calendar-bundle 0.1 requires symfony/symfony 2.0.* -> satisfiable by symfony/symfony[2.0.7, v2.0.10, v2.0.11, v2.0.12, v2.0.13, v2.0.14, v2.0.15, v2.0.16, v2.0.17, v2.0.18, v2.0.19, v2.0.20, v2.0.21, v2.0.22, v2.0.23, v2.0.9].
    - star/calendar-bundle 0.1.1 requires symfony/symfony 2.1.* -> satisfiable by symfony/symfony[v2.1.0, v2.1.0-BETA1, v2.1.0-BETA2, v2.1.0-BETA3, v2.1.0-BETA4,v2.1.0-RC1, v2.1.0-RC2, v2.1.1, v2.1.10, v2.1.11, v2.1.2, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, v2.1.8, v2.1.9].
    - Can only install one of: symfony/symfony[v2.2.0, 2.0.7].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.10].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.11].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.12].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.13].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.14].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.15].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.16].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.17].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.18].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.19].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.20].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.21].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.22].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.23].
    - Can only install one of: symfony/symfony[v2.2.0, v2.0.9].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.0].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.0-BETA1].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.0-BETA2].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.0-BETA3].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.0-BETA4].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.0-RC1].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.0-RC2].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.1].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.10].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.11].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.2].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.3].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.4].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.5].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.6].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.7].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.8].
    - Can only install one of: symfony/symfony[v2.2.0, v2.1.9].
    - Installation request for symfony/symfony == 2.2.0.0 -> satisfiable by symfony/symfony[v2.2.0].
    - Installation request for star/calendar-bundle 0.* -> satisfiable by star/calendar-bundle[0.1.1, 0.1].

错误的原因是什么?我正在考虑分叉项目并更改composer.json. 但是我应该放什么呢?

4

1 回答 1

1

只需阅读错误的前 3 行:

- Conclusion: remove symfony/symfony v2.2.0
- star/calendar-bundle 0.1 requires symfony/symfony 2.0.* -> satisfiable by symfony/symfony[2.0.7, v2.0.10, v2.0.11, v2.0.12, v2.0.13, v2.0.14, v2.0.15, v2.0.16, v2.0.17, v2.0.18, v2.0.19, v2.0.20, v2.0.21, v2.0.22, v2.0.23, v2.0.9].
- star/calendar-bundle 0.1.1 requires symfony/symfony 2.1.* -> satisfiable by symfony/symfony[v2.1.0, v2.1.0-BETA1, v2.1.0-BETA2, v2.1.0-BETA3, v2.1.0-BETA4,v2.1.0-RC1, v2.1.0-RC2, v2.1.1, v2.1.10, v2.1.11, v2.1.2, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, v2.1.8, v2.1.9].

第一行告诉我们symfony/symfony包的版本是错误的。它下面的 2 行给了我们错误的原因:

  • 0.1 版需要 Symfony 2.0.x
  • 0.1.1 版需要 Symfony 2.1.x

所以不支持2.2.x。

如果你想在 2.2 中使用这个包,你应该怎么做:

  1. 分叉捆绑包并使用 sf 2.2 进行测试
  2. 删除所有已弃用的内容并使其与 2.2 兼容
  3. 更新composer.json有类似的东西symfony/symfony: 2.2.*
  4. 使用您所做的更改请求 PR,让它合并并让包的作者创建一个新版本的包并在您的 composer.json 中使用该版本
于 2013-06-11T13:22:35.930 回答