我刚刚花了最后 2 个小时想知道为什么当我对我的项目进行 bin/vendors 更新时一切都崩溃了。我收到以下错误
fatal: github.com/symfony/DoctrineMigrationsBundle.git/info/refs not found: did you run git update-server-info on the server?
fatal: github.com/symfony/DoctrineMongoDBBundle.git/info/refs not found: did you run git update-server-info on the server?
fatal: github.com/symfony/DoctrineFixturesBundle.git/info/refs not found: did you run git update-server-info on the server?
我的部门没有做任何改变
[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
经过一番调查后,我发现 bundle 的 repo 位置已更改为 github.com/doctrine/。我不得不更改 deps 位置并从 vendors/bundles/Symfony/Bundle/中删除 bundle ,但这确实让我感到困惑。
除了奇怪的 git diff 和 DoctrineFixturesBundle 的自述文件中的一小段提及外,我根本找不到任何关于此的文档。 .这不是非 BC 更改吗?这不会影响每个使用这些 repo 协议(protocol)的人吗?如果它是非 BC 更改,为什么没有关于它的更多信息。我是唯一受影响的人吗?还是我做错了什么(供应商更新而不是安装)?
我看到在这些项目的 master 分支中,命名空间也在发生变化。这不是一个巨大的非 BC 变化吗?我担心将来当我要启动一个网站时可能会发生这种情况,而我似乎对此无能为力。
最佳答案
对于我们(使用 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',
关于php - Doctrine 的 Symfony Bundle repo 发生了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10842562/