How to disable dump symfony function on production

后端 未结 5 992
青春惊慌失措
青春惊慌失措 2021-01-02 20:03

How to disable dump() function, when its in production environment? If i forget the dump function anywhere It crashes with an 500 error

5条回答
  •  忘掉有多难
    2021-01-02 20:54

    NEW ANSWER AS OF 3.3:

    Now in Symfony 3.3+, you can dump to prod environment. Rather than turning up in the debug toolbar, it shows up in the content area of your page (so if you do this in the controller, it will be at the top).

    This can be handy to debug things that don't do the same between dev and prod, and then you can leave your debug code in as you develop, but just make sure before you deploy to a production environment that you comment out any dumps.

提交回复
热议问题