title: Yii2: How to prepare for debug and production environment?
body: <p>I know Yii defines and uses the constants <strong>YII_DEBUG</strong> and <strong>YII_ENV.</strong> Of course, they are set to to 'true' and 'dev' on my local machine. This is because the basic app template has prepared it this way in the <a href="https://github.com/yiisoft/yii2-app-basic/blob/master/web/index.php" rel="noreferrer">index.php</a> file. This file tells me also that I should remove those lines for production mode, i.e. on the production machine. Then those constants are set to 'false' and 'prod' by default. That's all okay and I understand it. 
  (More information can be found on <a href="http://www.yiiframework.com/doc-2.0/guide-structure-entry-scripts.html#defining-constants" rel="noreferrer">Defining Constants</a> and <a href="http://www.yiiframework.com/doc-2.0/guide-concept-configurations.html#environment-constants" rel="noreferrer">Environment Constants</a>.)</p>
  
  <p>My question: <strong>How can I best handle these constants when index.php is contained in VCS?</strong> In one environment they should exist, in the other not. And it could be a test machine as well, of course. Which options do I have? I think this is also a matter of the deployment method. Currently, I'm just pushing via Git to the production machine, what is a primitive deployment IMO...</p>
  
  <p>How do you do it? What do you suggest?</p>
  
  <p>EDIT: Actually, handling the params files is the same issue.</p>