How to set the environment in a Symfony2 console command

后端 未结 6 1182
清歌不尽
清歌不尽 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:23

    Maybe you could look at the implementation of the cache:clear command. This may give you some clues on how to choose the environment from a command.

    app/console help cache:clear
    

提交回复
热议问题