KhepinYamlFixturesBundle给出致命错误:调用未定义的方法Symfony \ Bundle \ DoctrineBundle \ Registry :: getManager()

时间:2012-08-31 08:42:27

标签: symfony doctrine-orm fixtures

我已经安装了[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和doctrine-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.

`

3 个答案:

答案 0 :(得分:2)

对于2.1,捆绑包需要具有版本“2. ”的灯具捆绑包。由于作曲家最近将“最小稳定性”切换为“稳定”,2。和dev-master不再等效。

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

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

例如。

更新:

我推送了代码,现在应该使用旧版本的Doctrine来解决这个问题。

答案 1 :(得分:1)

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

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

答案 2 :(得分:1)

我使用"dev-master"作为doctrine-fixtures-bundle与Symfony 2.1:

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

KhepinYamlFixturesBundle不支持它。

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