error.php File Reference

Error handling. More...

Go to the source code of this file.

Functions

 error_handler ($errno, $errstr, $errfile, $errline, $errcontext)
 Error handler for PHP errors.


Detailed Description

Error handling.

Definition in file error.php.


Function Documentation

error_handler ( errno,
errstr,
errfile,
errline,
errcontext 
)

Error handler for PHP errors.

This is a user-supplied error handler for PHP errors. It is registered in PHP via the set_error_handler() directive, and is called whenever a run-time error in PHP occurs.

We (try to) print a friendly message and a traceback. Then we exit.

Parameters:
$errno -- error number
$errstr -- error message
$errfile -- file name where the error occurred
$errline -- line number where the error occurred
$errcontext -- additional information (traceback data)
Note:
Other PHP functions should never call this function directly. Instead, the recommended way of handling errors is to raise an exception via PHP's user_error() directive, like this:
user_error("We goofed -- out of gronkulators", E_USER_ERROR);

Definition at line 28 of file error.php.

References smarty_init().

00028                                                                          {
00029         global $smarty;
00030 
00031         $debug = 0;
00032 
00033         if (empty($smarty)) {
00034                 $smarty =& smarty_init();
00035         }
00036 
00037         if (($errno & (E_ERROR | E_PARSE | E_CORE_ERROR | E_USER_ERROR)) == 0) {
00038                 return 0;
00039         } 
00040  
00041         $smarty->assign("errno" , $errno);
00042         $smarty->assign("errstr" , $errstr);
00043         $smarty->assign("errfile" , $errfile);
00044         $smarty->assign("errline" , $errline);
00045 
00046         if ($debug) {
00047                 $smarty->assign("errcontext" , 
00048                          htmlentities(print_r($errcontext, true)));
00049         }
00050 
00051         $smarty->display('header.tpl');
00052         $smarty->display('error.tpl');
00053         $smarty->display('footer.tpl');
00054         exit(1);
00055 }

Here is the call graph for this function:


Generated on Fri Jul 14 17:38:57 2006 for semapp by  doxygen 1.4.7