【问题标题】:Symfony 2.1.7 and doctrine migrations bundle errorSymfony 2.1.7 和学说迁移捆绑错误
【发布时间】:2013-02-06 15:57:39
【问题描述】:

我正在关注本教程:http://tutorial.symblog.co.uk/docs/extending-the-model-blog-comments.html#doctrine-2-migrations

1) 安装 Doctrine 迁移包

1.1) - 添加

 "doctrine/migrations": "dev-master",
 "doctrine/doctrine-migrations-bundle": "dev-master"

到 composer.json

1.2) 运行

 php composer.phar update

2) 添加

new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),

在 AppKernel.php 中

3) 运行

php app/console doctrine:migrations:diff

这应该运行命令并找到当前实体和数据库之间的差异,是吗? 但我得到了一个错误:

 Fatal error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle' not found in D:\xampp\htdocs\symblog.dev\app\AppKernel.php on line 23

这正是 (2.) 的行

你能帮帮我吗?欢迎任何建议!

【问题讨论】:

  • 您在运行php composer.phar update 时遇到任何问题吗?
  • 作曲家没问题,捆绑安装正常,但是当我将它们添加到 AppKernel.php 时,地狱就崩溃了;P

标签: symfony bundle doctrine-migrations


【解决方案1】:

我认为捆绑包同时被重命名了。尝试:(更新问题):

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        //...
        new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
    );
}

请参阅 DoctrineMigrationsBundle documentationDoctrineMigrationsBundle class

【讨论】:

  • 我在我的问题中粘贴了错误的命名空间/类。现在修好了。正如您所说,AppKernel 的内容是准确的.. 将添加源代码。
  • 感谢您的回答,检查了手册 - 没用,尝试了 2.1 Manual 和 Master 分支 - 这里也是应用程序内核:pastebincomposer.json:bastebin 我安装了两个捆绑包在供应商/学说中: - 教义夹具捆绑和教义迁移捆绑,它们都不起作用。固定装置的问题几乎相同。
  • @dopamine 尝试运行composer dump-autoload
  • 从架构差异生成新的迁移类到“D:/xampp/htdocs/symblog.dev/app/DoctrineMigrat ions/Version20130206185826.php”。 --------- 它就像一个魅力!
猜你喜欢
  • 2017-04-09
  • 2017-05-12
  • 1970-01-01
  • 1970-01-01
  • 2019-12-28
  • 2016-12-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多