Created
October 6, 2015 10:34
-
-
Save zarpio/38dbf8128c2c459be7d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Provide query string like ?test-mode=1 OR ?test-mode=0 | |
| **/ | |
| if ( isset( $_GET ) && isset( $_GET['test-mode'] ) ) { | |
| $_SESSION['test-mode'] = $_GET['test-mode']; | |
| } | |
| function isTestMode() { | |
| return $_SESSION['test-mode']; | |
| } | |
| /** display message, when running in test mode. **/ | |
| if ( isTestMode() ) { | |
| echo "*** Running in TEST mode ***<br>" . PHP_EOL; | |
| } else { | |
| echo "*** Running in LIVE mode ***<br>" . PHP_EOL; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment