| [ Index ] |
PHP Cross Reference of Limb3 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 * Limb PHP Framework 4 * 5 * @link http://limb-project.com 6 * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com) 7 * @license LGPL http://www.gnu.org/copyleft/lesser.html 8 */ 9 lmb_require('limb/core/src/lmbDelegate.class.php'); 10 11 /** 12 * class lmbErrorGuard. 13 * 14 * @package core 15 * @version $Id$ 16 */ 17 class lmbErrorGuard 18 { 19 static protected $fatal_error_delegate; 20 21 static function registerExceptionHandler() 22 { 23 $delegate = func_get_args(); 24 set_exception_handler(array(lmbDelegate :: objectify($delegate), 'invoke')); 25 } 26 27 static function registerFatalErrorHandler() 28 { 29 static $shutdown_registered = false; 30 31 $delegate = func_get_args(); 32 self :: $fatal_error_delegate = lmbDelegate :: objectify($delegate); 33 34 if(!$shutdown_registered) 35 { 36 register_shutdown_function(array('lmbErrorGuard', '_shutdownHandler')); 37 $shutdown_registered = true; 38 } 39 } 40 41 static function registerErrorHandler() 42 { 43 $delegate = func_get_args(); 44 set_error_handler(array(lmbDelegate :: objectify($delegate), 'invoke')); 45 } 46 47 static function _shutdownHandler() 48 { 49 if(!function_exists('error_get_last')) 50 return; 51 52 if(!$error = error_get_last()) 53 return; 54 55 if($error['type'] == E_ERROR) 56 self :: $fatal_error_delegate->invoke($error); 57 } 58 } 59 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Fri Aug 29 04:49:26 2008 | Cross-referenced by PHPXref 0.7 |