0
votes

I am facing a strain behaviour on the console of symfony2 . I have a local envinroment and if I execute:

php app/console doctrine:fixtures:load

purging database loading Application\Sonata\UserBundle\DataFixtures\ORM\LoadUserData loading ApplicationNewsBundle\DataFixtures\ORM\LoadAdvertisementData loading ApplicationNewsBundle\DataFixtures\ORM\LoadArticleData loading ApplicationNewsBundle\DataFixtures\ORM\LoadLiveBlogData loading ApplicationNewsBundle\DataFixtures\ORM\LoadVideoData

I upload the code to Heroku ( the same code) and I execute the same command but I only execute the two first fixtures:

purging database

loading Application\Sonata\UserBundle\DataFixtures\ORM\LoadUserData loading ApplicationNewsBundle\DataFixtures\ORM\LoadAdvertisementData

At this point, I suppose that is something related with the configuration, and I also executed the command on dev enviroment, but with the same result.

php app/console --env=dev doctrine:fixtures:load

I am using symfony 2.6.9.

2

2 Answers

0
votes

There are 2 obvious reasons why you may be experiencing this behavior:

  1. Wrong File Permissions on the remote system

    Check wether all the fixture files are readable by the user invoking the PHP process otherwise they may not be found and therefore not be loaded.

  2. Outdated composer Autoloader

    If you have dumped an optimized autoloader with -a / --classmap-authoritative or --apcu and you've deployed a new version with new fixture classes afterwards ... the new classes may not be in the classmap yet and aren't autoloaded. To fix this issue just dump the autoloader again by running composer dump-autoload -a.

0
votes

The problem was related to the path, the name of the folder is DataFIxtures with I in capital letter, it seems that is not a problem working with vagrant in local but when I use heroku container doesn't understand this path and it doesn't execute the command. Changing the name the issue is solved.