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 -D flag to httpd so that I can identify my production server in code, ie. isset($_SERVER['DEV']). Unfortunately, this does not work for scripts run from the command line since they're not under the Apache umbrella.
Essentially, I would like a clean, simple way to identify development vs. production that is available to every line of code.
What I have ruled out:
auto_prepend_file-- we are already using this directive in some applications, and you can't have more than one autoprepend.
What I am currently exploring:
- 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.
So, got any tricks for identifying dev/prod that doesn't involve injecting code into every script or application?