Lampwrights Forum

Lampwrights Forum (http://www.lampwrights.com/index.php)
-   PHP (http://www.lampwrights.com/forumdisplay.php?f=4)
-   -   Stepping through live code (http://www.lampwrights.com/showthread.php?t=9)

Jeff 07-19-2010 02:14 PM

Stepping through live code
 
Sometimes there is an issue on your site and you need to resolve it in real time. Here is a method I use to step through code so only I see the debug code/breakpoints. Here is a typical breakpoint:

Code:

if ($_SERVER['REMOTE_ADDR'] == '123.123.123.123') { echo "break"; exit; }
Of course, you need to change the IP address.

I use this method to test configurations or enable settings for just myself. For example, Vbulletin has a debug mode and if I need to debug the live site, I put this at the end of the config file:
Code:

if ($_SERVER['REMOTE_ADDR'] == '123.123.123.123') { $config['Misc']['debug'] = true; }


All times are GMT -4. The time now is 07:30 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2024, vBulletin Solutions, Inc.