I have a Prestashop 1.7.8 module that uses Symfony commands to perform scheduled tasks.
In my crontab, I can trigger $ php bin/console algoliaprestashop:reindex
It works fine in my Production environment, but not in my Development environment where I get that error message:
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "IndexCommand" from namespace "PrestaShop\Module\AlgoliaPrestashop\Command".
I got it to work by doing some nasty require('<insert path to PHP file>').
Production and Development are docker containers hosted on 2 AWS instances.
What we have change is that we turn the dev container on and off every night.
How can I fix that ?
The expected behaviour is that the Symfony Command $ php bin/console algoliaprestashop:reindex as defined in services.yaml instantiates the IndexCommand class and performs the execute method.
I have tried executing composer install and composer dump-autoload in the root folder, then in the module's folder. After that I have cleared the cache.