【问题标题】:Which DoctrineBundle version works with Symfony 2.0.15?哪个 DoctrineBundle 版本适用于 Symfony 2.0.15?
【发布时间】:2012-06-19 20:09:51
【问题描述】:

我已经花了几天时间尝试在 Symfony 2.0.15 中整理我的部门。我找不到兼容的捆绑包列表,我一直在 github 上追逐提交,试图遵循一系列非 BC 更改以获得适合我的版本列表。最终我选择放弃并升级到 composer,结果发现某些 Doctrine 核心需要 Symfony 2.1,而其他一些 Doctrine 捆绑包需要 Symfony

安装了以下 Bundles 的人可以告诉我他们在 deps.lock 中使用的稳定版本吗?

[symfony]
git=http://github.com/symfony/symfony.git
version=v2.0.15

[twig]
git=http://github.com/fabpot/Twig.git
version=v1.8.2

[monolog]
git=http://github.com/Seldaek/monolog.git
version=1.0.2

[doctrine-common]
git=http://github.com/doctrine/common.git
version=2.1.4

[doctrine-dbal]
git=http://github.com/doctrine/dbal.git
version=2.1.7

[doctrine]
git=http://github.com/doctrine/doctrine2.git
version=2.1.7

[swiftmailer]
git=http://github.com/swiftmailer/swiftmailer.git
version=v4.1.7

[assetic]
git=http://github.com/kriswallsmith/assetic.git
version=cc2e9adb744df0704a5357adc1cf9287c427420f

[twig-extensions]
git=http://github.com/fabpot/Twig-extensions.git

[metadata]
git=http://github.com/schmittjoh/metadata.git
version=1.0.0

[SensioFrameworkExtraBundle]
git=http://github.com/sensio/SensioFrameworkExtraBundle.git
target=/bundles/Sensio/Bundle/FrameworkExtraBundle
version=origin/2.0

[JMSSecurityExtraBundle]
git=http://github.com/schmittjoh/JMSSecurityExtraBundle.git
target=/bundles/JMS/SecurityExtraBundle
version=origin/1.0.x

[SensioDistributionBundle]
git=http://github.com/sensio/SensioDistributionBundle.git
target=/bundles/Sensio/Bundle/DistributionBundle
version=origin/2.0

[SensioGeneratorBundle]
git=http://github.com/sensio/SensioGeneratorBundle.git
target=/bundles/Sensio/Bundle/GeneratorBundle
version=origin/2.0

[AsseticBundle]
git=http://github.com/symfony/AsseticBundle.git
target=/bundles/Symfony/Bundle/AsseticBundle
version=v1.0.1

[doctrine-mongodb]
git=http://github.com/doctrine/mongodb.git

[doctrine-mongodb-odm]
git=http://github.com/doctrine/mongodb-odm.git

[DoctrineMongoDBBundle]
git=http://github.com/doctrine/DoctrineMongoDBBundle.git
target=/bundles/Symfony/Bundle/DoctrineMongoDBBundle
version=v2.0.1

[DoctrineMigrationsBundle]
git=https://github.com/doctrine/DoctrineMigrationsBundle.git
target=/bundles/Symfony/Bundle/DoctrineMigrationsBundle
version=origin/2.0

[doctrine-migrations]
git=http://github.com/doctrine/migrations.git

[doctrine-fixtures]
git=http://github.com/doctrine/data-fixtures.git

[DoctrineFixturesBundle]
git=https://github.com/doctrine/DoctrineFixturesBundle.git
target=/bundles/Symfony/Bundle/DoctrineFixturesBundle
version=origin/2.0

[DoctrineBundle]
git=http://github.com/doctrine/DoctrineBundle.git
target=/bundles/Doctrine/Bundle/DoctrineBundle

[FOSJsRoutingBundle]
git=http://github.com/FriendsOfSymfony/FOSJsRoutingBundle.git
target=/bundles/FOS/JsRoutingBundle

[GedmoDoctrineExtensions]
git=http://github.com/l3pp4rd/DoctrineExtensions.git
target=/gedmo-doctrine-extensions

[StofDoctrineExtensionsBundle]
git=http://github.com/stof/StofDoctrineExtensionsBundle.git
target=/bundles/Stof/DoctrineExtensionsBundle

使用这些组合,由于类不存在或重命名的方法,我得到一组恒定的错误,然后我在 github 存储库中查找并尝试修复解决此错误的提交/标记,只是得到另一组由于其他类不存在或重命名的方法而导致的错误。由于 Doctrine 组织的命名空间更改,我无法回到几周前的稳定状态 - (@see What happened to Doctrine's Symfony Bundle repos?)

另外,我不介意改用作曲家;这是我尝试过的composer.json,但不起作用

{
"require": {
      "symfony/symfony" : "v2.0.15",
      "symfony/doctrine-bridge": "2.1.x-dev",
      "doctrine/common" : "2.1.4",
      "doctrine/orm" : "2.1.6",
      "symfony/finder" : "v2.0.15",

      "symfony/assetic-bundle" : "2.0.x-dev",
      "twig/extensions" : "dev-master",
      "jms/security-extra-bundle" : "1.0.x",
      "sensio/framework-extra-bundle" : "2.0.x-dev",
      "sensio/distribution-bundle" : "2.0.x-dev",
      "sensio/generator-bundle" : "2.0.x-dev",

      "doctrine/doctrine-bundle": "v1.0.0-beta1",
      "doctrine/mongodb-odm-bundle": "v2.0.1",

},
"autoload": {
    "psr-0": {
        "Oh": "src/"
    }
}
}

每当我尝试修复 composer.json 中的依赖项时,我似乎陷入了一次又一次升级和降级相同软件包的循环,但总是收到错误“您的要求无法解决为一组可安装的软件包."。如果有人可以为我提供他们使用 Symfony 2.0.15 以及 Doctrine、MongoDB、DoctrineFixtures 和 DoctrineMigrations 捆绑包的 composer.json 设置,我将不胜感激。

【问题讨论】:

    标签: mongodb symfony doctrine-orm doctrine-odm composer-php


    【解决方案1】:

    这是我工作作曲家配置的一部分:

    {
        "require": {
            "php":              ">=5.3.3",
            "symfony/symfony":  "2.0.15",
            "doctrine/orm":     "2.1.7",
            "twig/extensions":  "*",
    
            "symfony/assetic-bundle":         "2.0.x-dev",
            "sensio/generator-bundle":        "2.0.*",
            "sensio/framework-extra-bundle":  "2.0.*",
            "jms/security-extra-bundle":      "1.0.*",
    
            "stof/doctrine-extensions-bundle":     "*",
            "doctrine/doctrine-migrations-bundle": "2.0.*"
        }
    }
    

    我没有使用 ODM。

    【讨论】:

    • 感谢 jakub。我想我试图在我的作曲家中包含太多的包。我确实设法通过用“*”替换所有包版本来获得一个工作作曲家,让它理清自己的依赖关系,但我想使用所有东西的不稳定版本是有风险的。我已将我的整个 composer.json 和 AppKernel 放在一个要点中,以帮助其他可能需要它的人gist.github.com/2947908
    • 如果你想锁定版本,packagist.org 可以帮助你。您可以查看包的版本及其依赖项。
    • 对我来说麻烦的是我在 composer.json 中包含了已经包含在其他包中的包,并且很难看到将要安装的所有内容。如果有一个工具可以查看树结构中的所有依赖项,而不是必须查找每个依赖项并记住什么依赖于什么,那将会很方便。
    猜你喜欢
    • 2010-11-30
    • 1970-01-01
    • 2012-02-17
    • 2015-12-04
    • 2011-05-18
    • 2012-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多