|
Posted by PleegWat on 11/02/06 13:47
Hi,
I'm using this function:
function die_quietly( $text='', $title='', $file='', $line='', $sql='' )
{
global $wowdb, $roster_conf, $wordings, $roster_menu;
// die_quitely died quietly
if (defined(ROSTER_DIED))
{
print '<pre>The quiet die function suffered a fatal error.
Die information below'."\n";
print 'First die data:'."\n";
print_r($GLOBALS['die_data']);
print "\n".'Second die data'."\n";
print_r(func_get_args());
exit();
}
define(ROSTER_DIED,1);
$GLOBALS['die_data'] = func_get_args();
// Snip stuff that generates a graphical error page
exit();
}
The purpose of this function is creating a graphical error page if
something in my package causes a fatal error, rather than just dying.
The purpose of the quoted part is preventing undesired recursion if
something inside the die_quietly() function calls the die_quietly()
function again.
This code however doesn't work correctly. defined(ROSTER_DIED) seems to
return false on the second function call, and return true on the third.
Which means it returns the reason die_quietly failed twice, but not the
reason die_quietly was originally called.
Can anyone explain to me why this happens?
--
PleegWat
Remove caps to reply
[Back to original message]
|