Re: debugging
| From: | Justin French | Date: | Wed, 19 Jan 2005 13:39:49 +0000 |
| Subject: | Re: debugging | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206742@lists.php.net to get a copy of this message | ||
On 19/01/2005, at 10:51 PM, Marek Kilimajer wrote:
Justin French wrote:That's a good point... Not that by debugging lines have anything dangerous in them, but it's still not right... Thanks... I think I'll revisit that line of code before anything goes live :)On 19/01/2005, at 5:36 PM, William Stokes wrote:Interesting. So I just need to use the same hosting server as you do and your scripts will tell me interesting facts ;)I would like to add some debugging/info code to my pages. In test environment of course. Any ideas how to do this? I mean for example to print to a web page the line number when the script fails or something like that. It's a pain on the **s to hunt typo's by just reading the source over and over again.William, I start by trying to programatically find out if I'm in a development or production environment and setting a constant DEV to true or false. For me, I development things on my desktop Mac, so the server and client are the same machine, and share the same IP address. So my check for DEV is if the client IP and server IP match. <? define('DEV',($_SERVER['REMOTE_ADDR']==$_SERVER['SERVER_ADDR'])); ?>
I use simple define('DEBUG', true'); in the main config file where also database login info is stored.I like to use exactly the same files for both development and live servers... it makes it much easier to mirror the site via FTP, commit via SVN, etc. --- Justin French, Indent.com.au justin.french@indent.com.au Web Application Development & Graphic Design