0
votes

I'm trying to manually add DoctrineFixturesBundle to my symfony project when I do so I get the following error.

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

I've followed the steps out lined here How to install a Symfony 2.0 Bundle from Zip file

In my AppKernel I have added:

$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();   

In autoload I have:

'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',

I have added the bundle to:

C:\wwwnet\symfony\vendor\bundles\Doctrine\Bundle\FixturesBundle

I've seen this question Symfony2 DoctrineFixturesBundle namespace error and it seems to suggest I am probably using the 2.1 bundle with 2.0 symfony

Also, the DoctrineBundle will never be in the Doctrine\Bundle namespace as long as you are on Symfony 2.0.x. Symfony 2.0.x ships with the DoctrineBundle under bundles\Symfony. Your problem is that you are trying to use a too new version of the DoctrineFixturesBundle which expects the DoctrineBundle under Doctrine\Bundle. My first suggestion, tagging the bundle to version=origin/2.0 should solve this. – leek Mar 11 at 20:22

How do I grab the 2.0 bundle for https://github.com/doctrine/DoctrineFixturesBundle? If that is even the problem, I am in the dark on this and have been scratching my head aimlessly for two days now.

  • Symfony: Symfony_Standard_Vendors_2.0.16
  • PHP: 5.3.6
  • Apache: 2.2
1

1 Answers

0
votes

In your deps file add

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

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

so you are defining version in the last line, do a bin/vendor update after that