6 * @copyright (c) 2011 phpBB Group
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
14 if (!defined('IN_PHPBB'))
19 class phpbb_error_collector
23 function phpbb_error_collector()
25 $this->errors = array();
30 set_error_handler(array(&$this, 'error_handler'));
35 restore_error_handler();
38 function error_handler($errno, $msg_text, $errfile, $errline)
40 $this->errors[] = array($errno, $msg_text, $errfile, $errline);
43 function format_errors()
46 foreach ($this->errors as $error)
53 list($errno, $msg_text, $errfile, $errline) = $error;
55 // Prevent leakage of local path to phpBB install
56 $errfile = phpbb_filter_root_path($errfile);
58 $text .= "Errno $errno: $msg_text at $errfile line $errline";