How can i get the location of an exit()/die() from within register_shutdown_function()?

This is a discussion on How can i get the location of an exit()/die() from within register_shutdown_function()? within the PHP General forums, part of the PHP Programming Forums category; On Wed, Jul 16, 2008 at 1:53 PM, tedd <tedd.sperling@gmail.com> wrote: > At 9:...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 07-16-2008
Eric Butera
 
Posts: n/a
Default Re: [PHP] How can i get the location of an exit()/die() from within register_shutdown_function()?

On Wed, Jul 16, 2008 at 1:53 PM, tedd <tedd.sperling@gmail.com> wrote:
> At 9:15 AM -0400 7/16/08, Eric Butera wrote:
>>
>> As an aside, if I were to see some jibberish about a query and line
>> numbers when I click a link I'd leave that site. (And for the
>> archives) It is a security vuln to show full file paths to an end
>> user. If someone is tampering with your system we shouldn't give them
>> any more information than they can already get.

>
> It can certainly help you for debugging, but I agree, it's not for
> production.
>
> tedd


I register an error handler & a shutdown function on new features so
that I can get error reports via email. I hate trying to sift thru
logs and junk so I really need it in my face. Of course this is a
performance hit as it actually has to send emails and parse errors,
but after I haven't got any mails in a while I turn it off.
Reply With Quote
  #12 (permalink)  
Old 07-16-2008
tedd
 
Posts: n/a
Default Re: [PHP] How can i get the location of an exit()/die() fromwithin register_shutdown_function()?

At 2:18 PM -0400 7/16/08, Eric Butera wrote:
>On Wed, Jul 16, 2008 at 1:53 PM, tedd <tedd.sperling@gmail.com> wrote:
>> At 9:15 AM -0400 7/16/08, Eric Butera wrote:
>>>
>>> As an aside, if I were to see some jibberish about a query and line
>>> numbers when I click a link I'd leave that site. (And for the
>>> archives) It is a security vuln to show full file paths to an end
>>> user. If someone is tampering with your system we shouldn't give them
>>> any more information than they can already get.

>>
>> It can certainly help you for debugging, but I agree, it's not for
>> production.
>>
>> tedd

>
>I register an error handler & a shutdown function on new features so
>that I can get error reports via email. I hate trying to sift thru
>logs and junk so I really need it in my face. Of course this is a
>performance hit as it actually has to send emails and parse errors,
>but after I haven't got any mails in a while I turn it off.


I don't really know how others debug, I work alone. But, I do all my
stuff online and use the following function:

function report($query, $line, $file)
{
echo($query . '<br>' .$line . '<br/>' . $file . '<br/>' .
mysql_error());
}

That gives me immediate notice of where the error occurred and what
the error was. When I take my code to production, I simply comment
out the echo().

I used to use a global to do that (show/not show errors), but
consider all my error stuff in is one file, it's easy enough to
comment out what I don't want to show.

Cheers,

tedd


--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:44 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0