title: Identify development vs. production server in PHP
body: <p>I work with two application servers on a daily basis: one development, one production. A variety of apps from different developers live on these boxes, as well as some scripts that run via cron. Currently, I am using the <a href="http://httpd.apache.org/docs/2.2/programs/httpd.html" rel="noreferrer"><code>-D</code> flag</a> to httpd so that I can identify my production server in code, ie. <code>isset($_SERVER['DEV'])</code>. Unfortunately, this does not work for scripts run from the command line since they're not under the Apache umbrella.</p>
  
  <p>Essentially, <strong>I would like a clean, simple way to identify development vs. production that is available to every line of code</strong>.</p>
  
  <p>What I have ruled out:</p>
  
  <ul>
  <li><code>auto_prepend_file</code> -- we are already using this directive in some applications, and you can't have more than one autoprepend.</li>
  </ul>
  
  <p>What I am currently exploring:</p>
  
  <ul>
  <li>Custom extension -- I'm sure creating a new extension that only defines a new constant (possibly influenced by an ini setting) would not be the hardest thing in the world, but I have no prior experience in this area.</li>
  </ul>
  
  <p>So, got any tricks for identifying dev/prod that doesn't involve injecting code into every script or application?</p>