Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Symfone "doctrine:fixtures:load" command 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.

like image 827
Siarhei Avatar asked Dec 06 '16 20:12

Siarhei


3 Answers

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();
like image 171
Did Avatar answered Oct 12 '22 19:10

Did


php bin/console default environment is PROD

and fixtures proper installation is require-dev

so proper function call is:

php bin/console --env=dev doctrine:fixtures:load
like image 23
ochitos Avatar answered Oct 12 '22 19:10

ochitos


Also rm -rf var/cache worked for me (after the bundle registration)

like image 20
Ruslan Zelinskyy Avatar answered Oct 12 '22 18:10

Ruslan Zelinskyy