You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Recognizing Prod vs. Test Sites in a CPM

Incorrect Answer
edited Jun 13, 2022 4:12AM in General Technical Discussions 3 comments


Looking for a reliable way to determine whether a custom process/event handler is running on a prod or a test site.


I have this custom script/event handler (CPM) running on one of my customers' sites. Overall, the script is not important except that it's an integration that tries to target one URL if it's running on a production site; and a different one if it's running on an upgrade/test site. (See attached image.)

The engineer who wrote this script tried to use every kind of value in $_SERVER to deduce whether the site name contains two dashes or two underscores...but exactly none of these are populated in CPMs running on modern versions of OSvC. At the very end of these tests is

Howdy, Stranger!

Log In

To view full details, sign in.


Don't have an account? Click here to get started!