diff options
author | omniError <omniError@github> | 2014-11-11 20:20:52 -0600 |
---|---|---|
committer | omniError <omniError@github> | 2014-11-11 20:20:52 -0600 |
commit | efd4b43c1bbea587a480c145d8a79066ae78d9a3 (patch) | |
tree | fe6a4ef8677a99053de644e45d3fe93a03c67269 /phpBB/phpbb/error_collector.php | |
parent | a143a19b8bcb3dc4d9b4a20c85776852c30642f2 (diff) | |
download | forums-efd4b43c1bbea587a480c145d8a79066ae78d9a3.tar forums-efd4b43c1bbea587a480c145d8a79066ae78d9a3.tar.gz forums-efd4b43c1bbea587a480c145d8a79066ae78d9a3.tar.bz2 forums-efd4b43c1bbea587a480c145d8a79066ae78d9a3.tar.xz forums-efd4b43c1bbea587a480c145d8a79066ae78d9a3.zip |
[ticket/13306] constructor sets error types
https://tracker.phpbb.com/browse/PHPBB3-13306
PHPBB3-13306
Diffstat (limited to 'phpBB/phpbb/error_collector.php')
-rw-r--r-- | phpBB/phpbb/error_collector.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/phpBB/phpbb/error_collector.php b/phpBB/phpbb/error_collector.php index d2a481fc6c..50587cc4ef 100644 --- a/phpBB/phpbb/error_collector.php +++ b/phpBB/phpbb/error_collector.php @@ -16,15 +16,27 @@ namespace phpbb; class error_collector { var $errors; + var $error_types; - function __construct() + /** + * Constructor. + * + * The variable $error_types may be set to a mask of PHP error types that + * the collector should keep, e.g. `E_ALL`. If unset, the current value of + * the error_reporting() function will be used to determine which errors + * the collector will keep. + * + * @param int|null $error_types + */ + function __construct($error_types = null) { $this->errors = array(); + $this->error_types = !empty($error_types) ? $error_types : error_reporting(); } function install() { - set_error_handler(array(&$this, 'error_handler'), error_reporting()); + set_error_handler(array(&$this, 'error_handler'), $this->error_types); } function uninstall() |