【问题标题】:What happened to Doctrine's Symfony Bundle repos?Doctrine 的 Symfony Bundle 存储库发生了什么?
【发布时间】:2012-06-06 05:44:34
【问题描述】:

我刚刚花了两个小时想知道为什么当我对我的项目进行 bin/vendors 更新时一切都崩溃了。我收到以下错误

致命:github.com/symfony/DoctrineMigrationsBundle.git/info/refs 未找到:您是否在服务器上运行了 git update-server-info?

致命:github.com/symfony/DoctrineMongoDBBundle.git/info/refs not found:你在服务器上运行过 git update-server-info 吗?

致命:github.com/symfony/DoctrineFixturesBundle.git/info/refs 未找到:您是否在服务器上运行了 git update-server-info?

我的部门没有改变任何东西

[DoctrineMigrationsBundle]
    git=http://github.com/symfony/DoctrineMigrationsBundle.git
    target=/bundles/Symfony/Bundle/DoctrineMigrationsBundle
[doctrine-migrations]
    git=http://github.com/doctrine/migrations.git   

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

[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/symfony/DoctrineMongoDBBundle.git
    target=/bundles/Symfony/Bundle/DoctrineMongoDBBundle
    version=v2.0.0

经过一番调查,我发现包的 repo 位置已更改为 github.com/doctrine/。我不得不更改 deps 位置并从 vendor/bundles/Symfony/Bundle/ 中删除捆绑包,但这确实让我感到困惑。

除了奇怪的 git diff 和 DoctrineFixturesBundle 的自述文件中的一个小提及之外,我根本找不到任何文档。这不是非 BC 变化吗?这不会影响使用这些存储库的每个人吗?如果是非 BC 更改,为什么没有更多信息。只有我受影响吗?还是我做错了什么(供应商更新而不是安装)?

我看到在这些项目的主分支中,命名空间也在发生变化。这不是大规模的非 BC 变化吗?我担心这可能会在我即将启动一个网站时发生,而我似乎对此无能为力。

【问题讨论】:

  • 如果有其他人处于相同的情况,我还必须将 AppKernel 中的这些类更改为 "new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle()"、"new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle( )”。我还必须注册命名空间 "'Doctrine\\Bundle' => __DIR__.'/../vendor/bundles',"
  • 我用于 DoctrineMongoDBBundle (v2.0.1) 的当前标签没有改变它的命名空间,所以它应该留在 bundles/Symfony/Bundle 目录中

标签: php symfony doctrine-orm bundles


【解决方案1】:

对于我们(使用 Symfony 2.0.4)来说,它只需更改 deps 中的 git-url 并将其设置为跟踪分支 2.0 即可。如果您选择此方法,则不得(!)将 AppKernel.php 中的路径调整为 Doctrine 命名空间。我们的部门现在看起来像这样:

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


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

AppKernel.php 看起来还是一样的:

new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
new Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle(),

另外,请确保您仍然在 autoload.php 中注册了 DoctrineBundles:

'Symfony\\Bundle\\DoctrineFixturesBundle' => __DIR__.'/../vendor/bundles',
'Symfony\\Bundle\\DoctrineMigrationsBundle' => __DIR__.'/../vendor/bundles',

【讨论】:

  • 你用的是什么版本的学说?我收到错误“致命错误:第 28 行的 /vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Command/MigrationsDiffDoctrineCommand.php 中找不到类 'Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand'” - 但奇怪的是我在 git 历史记录中找不到任何版本 github.com/doctrine/dbal/tree/2.2/lib/Doctrine/DBAL 的 DBAL/Migrations 文件夹
  • @Ollie 我们正在使用以下 gitRepositories:[doctrine] github.com/doctrine/doctrine2.git version=2.1.2 [doctrine-dbal] github.com/doctrine/dbal.git version=2.1.3
【解决方案2】:

这发生在很久以前:http://symfony.com/blog/symfony-2-1-the-doctrine-bundle-has-moved-to-the-doctrine-organization

他们为尚未更新的人保留旧的存储库。我不会说这真的是一个 BC 中断,因为它不是更改代码,只是提供包的位置。

也许只是访问/订阅 symfony 博客和任何相关的 Twitter 帐户。他们今天早些时候提到了这个删除:https://twitter.com/jmikola/status/207852349782368256

【讨论】:

  • 好吧,我在 3 周前从 Symfony 文档中复制了这些链接,所以这对我来说是个新闻。而且我认为 BC 的定义是任何更改都不会影响使用旧版本的人
  • 我已经更新了它,但我不断收到哎呀,好像出了点问题。 ServiceNotFoundException:您请求了一个不存在的服务“doctrine.odm.mongodb”。有什么解决办法吗?
猜你喜欢
  • 1970-01-01
  • 2018-05-26
  • 1970-01-01
  • 2016-05-05
  • 1970-01-01
  • 2010-09-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多