Search code examples
phpdoctrine-ormdoctrinesymfony

The Symfony "doctrine:fixtures:load" command is missing


I have Symfony 3.1 project with Doctrine and doctrine/doctrine-fixtures-bundle and doctrine/data-fixtures installed.

However, when i run a console command

php bin/console doctrine:fixtures:load

I get a message saying that there are no commands defined in the doctrine:fixtures namespace.

The class Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand exists.

Please suggest how to fix that.


Solution

  • Run first php bin/console and see if the command appear in the list.

    If it doesn't, then you have to load the bundle in the AppKernel.php

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