[Customisation Database Commits] r594 - in /trunk/titania: common.php includes/functions.php

Nathan Guse exreaction at phpbb.com
Sat Feb 13 19:52:17 GMT 2010


Author: exreaction
Date: Sat Feb 13 19:52:17 2010
New Revision: 594

Log:
Exception handler

Modified:
    trunk/titania/common.php
    trunk/titania/includes/functions.php

Modified: trunk/titania/common.php
==============================================================================
*** trunk/titania/common.php (original)
--- trunk/titania/common.php Sat Feb 13 19:52:17 2010
***************
*** 29,34 ****
--- 29,36 ----
  // Include our core functions
  titania::_include('functions');
  
+ set_exception_handler('titania_exception_handler');
+ 
  // Set up our auto-loader
  spl_autoload_register(array('titania', 'autoload'));
  

Modified: trunk/titania/includes/functions.php
==============================================================================
*** trunk/titania/includes/functions.php (original)
--- trunk/titania/includes/functions.php Sat Feb 13 19:52:17 2010
***************
*** 17,22 ****
--- 17,40 ----
  }
  
  /**
+ * Exception handler
+ *
+ * @param mixed $exception
+ */
+ function titania_exception_handler($exception)
+ {
+ 	$message = $exception->getMessage();
+ 
+ 	// display the trace for administrators
+ 	if (phpbb::$auth->acl_get('a_'))
+ 	{
+ 		$message .= '<br /><br /><pre>' . var_export($exception->getTrace(), true) . '</pre>';
+ 	}
+ 
+ 	trigger_error($message);
+ }
+ 
+ /**
   * Error and message handler, call with trigger_error
   */
  function titania_msg_handler($errno, $msg_text, $errfile, $errline)




More information about the customisationdb-commits mailing list