【问题标题】:KhepinYamlFixturesBundle gives fatal error: call to undefined method Symfony\Bundle\DoctrineBundle\Registry::getManager()KhepinYamlFixturesBundle 给出致命错误:调用未定义的方法 Symfony\Bundle\DoctrineBundle\Registry::getManager()
【发布时间】:2012-08-31 08:42:27
【问题描述】:

我已经安装了 [KhepinYamlFixturesBundle][1] Symfony 2.0.16 来加载固定装置,但是当我运行时

php app/console khepin:yamlfixtures:load

我收到此错误:

致命错误:在第 138 行调用 D:\public_html\s2\trunk\src\Khepin\YamlFixturesBundle\Loader\YamlLoader.php 中未定义的方法 Symfony\Bundle\DoctrineBundle\Registry::getManager()

有解决办法吗?

编辑:

我也尝试过使用 Symfony 2.1。成功安装 Symfony 2.1 和教义-fixtures-bundle 后,我运行:

php composer.phar update khepin/yaml-fixtures-bundle

上面写着:

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

Problem 1

- Installation request for khepin/yaml-fixtures-bundle dev-master -> satisfiable by khepin/yaml-fixtures-bundle dev-master.

- Conclusion: don't install doctrine/doctrine-fixtures-bundle v2.1.0-ALPHA

- Conclusion: remove doctrine/doctrine-fixtures-bundle dev-master

- khepin/yaml-fixtures-bundle dev-master requires doctrine/doctrine-fixtures-bundle 2.* -> satisfiable by 
  doctrine/doctrine-fixtures-bundle v2.0.0, doctrine/doctrine-fixtures-bundle v2.0.1, 
  doctrine/doctrine-fixtures-bundle v2.1.0-ALPHA, doctrine/doctrine-fixtures-bundle 2.0.x-dev.

- Can only install one of: doctrine/doctrine-fixtures-bundle dev-master, doctrine/doctrine-fixtures-bundle v2.0.0.

- Can only install one of: doctrine/doctrine-fixtures-bundle dev-master, doctrine/doctrine-fixtures-bundle v2.0.1.

- Can only install one of: doctrine/doctrine-fixtures-bundle dev-master, doctrine/doctrine-fixtures-bundle 2.0.x-dev.

- Installation request for doctrine/doctrine-fixtures-bundle dev-master -> satisfiable by doctrine/doctrine-fixtures-bundle dev-master.

`

【问题讨论】:

    标签: symfony doctrine-orm fixtures


    【解决方案1】:

    对于 2.1,捆绑包需要版本为“2.”的固定装置捆绑包。由于 composer 最近将“最低稳定性”切换为“稳定”,因此 2. 和 dev-master 不再等价。

    如果你真的需要“dev-master”,你可以使用:

    require: {
        "khepin/yaml-fixtures-bundle": "dev-master as 2.1.0"
        ...
    }
    

    例如。

    更新:

    我推送了代码,现在应该用旧版本的 Doctrine 修复这个问题。

    【讨论】:

      【解决方案2】:

      这是一个已知的错误:https://github.com/khepin/KhepinYamlFixturesBundle/issues/14

      如果可以的话,你应该尝试使用 Symfony 2.1。

      【讨论】:

      • 我建议你在 Github 上关注这个问题。
      【解决方案3】:

      我在 Symfony 2.1 中使用 "dev-master" 进行教义夹具捆绑:

           `"doctrine/doctrine-fixtures-bundle": "dev-master"`
      

      KhepinYamlFixturesBundle 不支持。

      在我的composer.json 文件中将其更改为"doctrine/doctrine-fixtures-bundle": "v2.1.0-ALPHA" 后,它安装良好

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-01-15
        • 2015-01-28
        • 2015-05-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-09-03
        相关资源
        最近更新 更多