Search code examples
doctrine-ormsymfony-3.2

bin/console without working DB


I would like to be able to run symfony php bin/console without configured dbal.

I want to run some non-db related commands on CI without db.

Is it somehow possible?

Thanks.


Solution

  • As suggested by Cerad in his comment, you should remove the DoctrineBundle from AppKernel.php.

    If you do need that bundle in other contexts for your app (e.g. accessing from a browser) than you could define a customized environment (e.g. console) and enable the bundle only in the other environments (prod, dev, test are the default). See https://symfony.com/doc/current/configuration/environments.html