xonegirlz
xonegirlz

Reputation: 8977

issue with doctrine in symfony 2.0

I am trying to run:

php app/console doctrine:fixtures:load

but I am constantly getting this error:

Fatal error: Class 'Symfony\Bundle\DoctrineFixturesBundle' not found in /Library/WebServer/Documents/Symfony/app/AppKernel.php on line 17

Here's my AppKernel.php:

<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

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(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
            new Acme\HelloBundle\AcmeHelloBundle(),
            new Blogger\BlogBundle\BloggerBlogBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
}

and here's part of the reps file I have related to doctrine:

[doctrine-common]
    git=http://github.com/doctrine/common.git
    version=2.2.0

[doctrine-dbal]
    git=http://github.com/doctrine/dbal.git
    version=2.2.1

[doctrine]
    git=http://github.com/doctrine/doctrine2.git
    version=2.2.0

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

[DoctrineFixturesBundle]
    git=http://github.com/doctrine/DoctrineFixturesBundle.git
    target=bundles/Doctrine/Bundle/FixturesBundle

I am on Symfony 2.0

Upvotes: 0

Views: 572

Answers (2)

CriticalImpact
CriticalImpact

Reputation: 690

Did you add this 'Doctrine\Common\DataFixtures' => DIR.'/../vendor/doctrine-fixtures/lib', Do your autoload.php file?

Upvotes: 1

simshaun
simshaun

Reputation: 21476

You are using the Symfony 2.1 compatible version of the Fixtures bundle. Because you are running Symfony 2.0, you need to use the 2.0 compatible branch of the FixturesBundle, which happens to be named 2.0.

Change your deps file:

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

And install vendors again.

Upvotes: 1

Related Questions