note 86310 deleted from function.debug-backtrace by danbrown
| From: | danbrown@php.net | Date: | Fri, 09 Apr 2010 00:25:32 +0000 |
| Subject: | note 86310 deleted from function.debug-backtrace by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168052@lists.php.net to get a copy of this message | ||
Note Submitter: passionplay at hotmail dot com
----
My two cents. See my XML Handler which uses this class.
<?php
// Basic error functions
class errorBase
{
function backtrace($provideObject=false)
{
foreach(debug_backtrace($provideObject) as $row)
{
if($last!=$row['file'])
echo "File: $file<br>\n'";
$last=$row['file'];
echo " Line: $row[line]: ";
if($row['class']!='')
echo "$row[class]$row[type]$row[function]";
else
echo "$row[function]";
echo "(";
echo join("', '",$args);
echo ")<br>\n";
}
}
function error($msg,$fatal=false)
{
echo "<div align=\"center\"><font
color=\"red\"><b>Error: $msg</b></font></div>";
$last='';
$this->backtrace();
exit();
}
function fatalError($msg){return $this->error($msg,true);}
}
?>