How to set the environment in a Symfony2 console command

后端 未结 6 1184
清歌不尽
清歌不尽 2021-01-31 14:46

Hopefully a simple question - how does one specify which environment to use when running a console command in Symfony2. I\'ve created a few commands, however I would like to run

6条回答
  •  梦如初夏
    2021-01-31 15:36

    There is another variant, not so convenient though, but works also with composer

    SYMFONY_ENV=prod app/console cache:clear
    

提交回复
热议问题