我想手动添加DoctrineFixturesBundle到我的symfony项目,当我这样做时,我得到以下错误。Symfony2 - DoctrineFixturesBundle - DoctrineCommand not found
C:\wwwnet\symfony>php app/console doctrine:fixtures:load
Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand' not found in C:\wwwnet\symfony\vendor\bundles\Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand.php on line 34
我已经按照我加入这里How to install a Symfony 2.0 Bundle from Zip file
林立在我AppKernel步骤进行:
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
在自动加载,我有:
'Doctrine\\Bundle' => __DIR__.'/../vendor/bundles',
//'Symfony\\Bundle\\DoctrineFixturesBundle' => __DIR__.'/../vendor/bundles',
//'Doctrine\\Bundle\\DoctrineFixturesBundle' => __DIR__.'/../vendor/bundles',
'Doctrine\\Common\\DataFixtures' => __DIR__.'/../vendor/doctrine-fixtures/lib',
'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
'Doctrine\\DBAL' => __DIR__.'/../vendor/doctrine-dbal/lib',
'Doctrine' => __DIR__.'/../vendor/doctrine/lib',
我已经加入捆绑到:
C:\wwwnet\symfony\vendor\bundles\Doctrine\Bundle\FixturesBundle
我已经看到了这个问题Symfony2 DoctrineFixturesBundle namespace error,看来我可能使用2.1包2.0 symfony的建议
此外,DoctrineBundle永远不会在原则\包命名空间,只要你在Symfony 2.0.x上。 Symfony 2.0.x随捆绑\ Symfony下的DoctrineBundle一起提供。你的问题是你正在尝试使用DoctrineFixturesBundle的新版本,该版本需要Doctrine \ Bundle下的DoctrineBundle。我的第一个建议,标签捆绑版本=起源/ 2.0应该解决这个问题。 - 韭菜3月11日20:22
我该如何抓取2.0包,为https://github.com/doctrine/DoctrineFixturesBundle?如果那就是问题,那么我就在这个黑暗中,并且已经漫无目的地抓了我两天了。
- 的Symfony:Symfony_Standard_Vendors_2.0.16
- PHP:5.3.6
- 阿帕奇:2.2
感谢您的回复,上次我做了一次供应商更新,它删除了我的代码库。无论如何要为DoctrineFixturesBundle 2.0版本执行手动下载? – lookbadgers 2012-08-04 16:46:57
拉分支2.0然后放在厂商文件夹,应该做的伎俩。 – amitchhajer 2012-08-04 17:07:22
谢谢你的诀窍 – lookbadgers 2012-08-06 07:51:19