diff options
| author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-03-06 20:14:06 -0500 |
|---|---|---|
| committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-03-06 20:16:17 -0500 |
| commit | 24834543eef54650d198e1eb2b3a851e1ce08227 (patch) | |
| tree | c6418eb5148bb124404384df48eb98c90372c8f6 | |
| parent | 17693c2802c92297251f5cd94cc5452f5e54eb0b (diff) | |
| download | forums-24834543eef54650d198e1eb2b3a851e1ce08227.tar forums-24834543eef54650d198e1eb2b3a851e1ce08227.tar.gz forums-24834543eef54650d198e1eb2b3a851e1ce08227.tar.bz2 forums-24834543eef54650d198e1eb2b3a851e1ce08227.tar.xz forums-24834543eef54650d198e1eb2b3a851e1ce08227.zip | |
[ticket/10057] Moved error collector class into its own file.
This will make it autoloadable in 3.1. This commit breaks 3.0
since no code includes the error collector. Such include code
will be in its own commit since it will need to be reverted in 3.1.
PHPBB3-10057
| -rw-r--r-- | phpBB/includes/error_collector.php | 45 | ||||
| -rw-r--r-- | phpBB/includes/functions.php | 44 |
2 files changed, 45 insertions, 44 deletions
diff --git a/phpBB/includes/error_collector.php b/phpBB/includes/error_collector.php new file mode 100644 index 0000000000..8b4a7660e9 --- /dev/null +++ b/phpBB/includes/error_collector.php @@ -0,0 +1,45 @@ +<?php + +class phpbb_error_collector +{ + var $errors; + + function phpbb_error_collector() + { + $this->errors = array(); + } + + function install() + { + set_error_handler(array(&$this, 'error_handler')); + } + + function uninstall() + { + restore_error_handler(); + } + + function error_handler($errno, $msg_text, $errfile, $errline) + { + $this->errors[] = array($errno, $msg_text, $errfile, $errline); + } + + function format_errors() + { + $text = ''; + foreach ($this->errors as $error) + { + if (!empty($text)) + { + $text .= "<br />\n"; + } + list($errno, $msg_text, $errfile, $errline) = $error; + $text .= "Errno $errno: $msg_text"; + if (defined('DEBUG')) + { + $text .= " at $errfile line $errline"; + } + } + return $text; + } +} diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 39a02034c4..398a02380b 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3928,50 +3928,6 @@ function msg_handler($errno, $msg_text, $errfile, $errline) return false; } -class phpbb_error_collector -{ - var $errors; - - function phpbb_error_collector() - { - $this->errors = array(); - } - - function install() - { - set_error_handler(array(&$this, 'error_handler')); - } - - function uninstall() - { - restore_error_handler(); - } - - function error_handler($errno, $msg_text, $errfile, $errline) - { - $this->errors[] = array($errno, $msg_text, $errfile, $errline); - } - - function format_errors() - { - $text = ''; - foreach ($this->errors as $error) - { - if (!empty($text)) - { - $text .= "<br />\n"; - } - list($errno, $msg_text, $errfile, $errline) = $error; - $text .= "Errno $errno: $msg_text"; - if (defined('DEBUG')) - { - $text .= " at $errfile line $errline"; - } - } - return $text; - } -} - /** * Queries the session table to get information about online guests * @param int $item_id Limits the search to the item with this id |
