Re: [PHP] How can i get the location of an exit()/die() from within register_shutdown_function()?
- From: tedd.sperling@xxxxxxxxx (tedd)
- Date: Wed, 16 Jul 2008 08:41:55 -0400
At 9:23 AM +0200 7/16/08, Mathijs van Veluw wrote:
Hello there,
I have an shutdown function to catch fatal-errors etc..
Now when there is an exit() somewhere i get an empty message from get_last_error().
I want to know the location of this exit() or die().
Is there a way to get the file and line-number from where the exit/die originated?
Thx in advance.
Mathijs:
For MySQL failures I use:
$result = mysql_query($query) or die(report($query,__LINE__ ,__FILE__));
function report($query, $line, $file)
{
echo($query . '<br>' .$line . '<br/>' . $file . '<br/>' . mysql_error());
}
Perhaps you can modify that for your use.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
.
- References:
- How can i get the location of an exit()/die() from within register_shutdown_function()?
- From: Mathijs van Veluw
- How can i get the location of an exit()/die() from within register_shutdown_function()?
- Prev by Date: Re: [PHP] How can i get the location of an exit()/die() from within register_shutdown_function()?
- Next by Date: RE: [PHP] Downloading a file
- Previous by thread: Re: [PHP] How can i get the location of an exit()/die() from within register_shutdown_function()?
- Next by thread: Re: [PHP] How can i get the location of an exit()/die() from within register_shutdown_function()?
- Index(es):
Relevant Pages
|