首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Symfony2:版本2.0.1和DoctrineMigrationsBundle

Symfony2:版本2.0.1和DoctrineMigrationsBundle
EN

Stack Overflow用户
提问于 2011-09-02 14:30:04
回答 1查看 1.4K关注 0票数 1

全!这是怎么回事?今天,我尝试从GitHub重新安装Symfony2 (2.0.1)的新版本

代码语言:javascript
复制
$ app/vendors install --reinstall

使用我的内核和自动加载器配置:

代码语言:javascript
复制
class AppKernel extends Kernel
{
  public function registerBundles()
  {
    $bundles = array(
      new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
      new Symfony\Bundle\SecurityBundle\SecurityBundle(),
      new Symfony\Bundle\TwigBundle\TwigBundle(),
      new Symfony\Bundle\MonologBundle\MonologBundle(),
      new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
      new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
      new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
      new Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle(),
      ...

$loader->registerNamespaces(array(
  'Symfony'          => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
  'Sensio'           => __DIR__.'/../vendor/bundles',
  'JMS'              => __DIR__.'/../vendor/bundles',
  'Doctrine\\Common\\DataFixtures' => __DIR__.'/../vendor/doctrine-fixtures/lib',
  'Doctrine\\DBAL\\Migrations' => __DIR__.'/../vendor/doctrine-migrations/lib',
  'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
  'Doctrine\\DBAL'   => __DIR__.'/../vendor/doctrine-dbal/lib',
  'Doctrine'         => __DIR__.'/../vendor/doctrine/lib',
  'Monolog'          => __DIR__.'/../vendor/monolog/src',
  'Assetic'          => __DIR__.'/../vendor/assetic/src',
  'Metadata'         => __DIR__.'/../vendor/metadata/src',

));

文件Symfony2-root/deps

代码语言:javascript
复制
[doctrine-migrations]
  git=http://github.com/doctrine/migrations.git

[DoctrineMigrationsBundle]
  git=http://github.com/symfony/DoctrineMigrationsBundle.git

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

[DoctrineFixturesBundle]
  git=http://github.com/symfony/DoctrineFixturesBundle.git
target=/bundles/Symfony/Bundle/DoctrineFixturesBundle

但是出现了一个奇怪的错误:致命错误:在以下位置找不到类'Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle‘

有人知道这是怎么回事吗?谢谢

EN

回答 1

Stack Overflow用户

发布于 2011-09-03 11:44:01

解决了。是我的错

我忘了在deps中加一行。

代码语言:javascript
复制
[DoctrineMigrationsBundle]
    git=http://github.com/symfony/DoctrineMigrationsBundle.git
    target=/bundles/Symfony/Bundle/DoctrineMigrationsBundle

而不是

代码语言:javascript
复制
[DoctrineMigrationsBundle]
    git=http://github.com/symfony/DoctrineMigrationsBundle.git

现在一切都好了。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7279930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档