From a143a19b8bcb3dc4d9b4a20c85776852c30642f2 Mon Sep 17 00:00:00 2001 From: omniError Date: Mon, 10 Nov 2014 18:05:18 -0600 Subject: [ticket/13306] add error level to collector https://tracker.phpbb.com/browse/PHPBB3-13306 PHPBB3-13306 --- phpBB/phpbb/error_collector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/error_collector.php b/phpBB/phpbb/error_collector.php index 7141f83174..d2a481fc6c 100644 --- a/phpBB/phpbb/error_collector.php +++ b/phpBB/phpbb/error_collector.php @@ -24,7 +24,7 @@ class error_collector function install() { - set_error_handler(array(&$this, 'error_handler')); + set_error_handler(array(&$this, 'error_handler'), error_reporting()); } function uninstall() -- cgit v1.2.1 From efd4b43c1bbea587a480c145d8a79066ae78d9a3 Mon Sep 17 00:00:00 2001 From: omniError Date: Tue, 11 Nov 2014 20:20:52 -0600 Subject: [ticket/13306] constructor sets error types https://tracker.phpbb.com/browse/PHPBB3-13306 PHPBB3-13306 --- phpBB/phpbb/error_collector.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') 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() -- cgit v1.2.1 From 834a93f76c9b2efe9a4fa89200fe24f844df7479 Mon Sep 17 00:00:00 2001 From: omniError Date: Tue, 11 Nov 2014 20:23:13 -0600 Subject: [ticket/13306] allow 0 error types https://tracker.phpbb.com/browse/PHPBB3-13306 PHPBB3-13306 --- phpBB/phpbb/error_collector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/error_collector.php b/phpBB/phpbb/error_collector.php index 50587cc4ef..688bc0c422 100644 --- a/phpBB/phpbb/error_collector.php +++ b/phpBB/phpbb/error_collector.php @@ -31,7 +31,7 @@ class error_collector function __construct($error_types = null) { $this->errors = array(); - $this->error_types = !empty($error_types) ? $error_types : error_reporting(); + $this->error_types = ($error_types !== null) ? $error_types : error_reporting(); } function install() -- cgit v1.2.1 From 0a4ffb7cf818c399f4956773ff7cb8e5b0243fa3 Mon Sep 17 00:00:00 2001 From: omniError Date: Wed, 12 Nov 2014 16:01:49 -0600 Subject: [ticket/13306] move error_reporting call https://tracker.phpbb.com/browse/PHPBB3-13306 PHPBB3-13306 --- phpBB/phpbb/error_collector.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/error_collector.php b/phpBB/phpbb/error_collector.php index 688bc0c422..bf8efd1065 100644 --- a/phpBB/phpbb/error_collector.php +++ b/phpBB/phpbb/error_collector.php @@ -26,17 +26,18 @@ class error_collector * the error_reporting() function will be used to determine which errors * the collector will keep. * + * @see PHPBB3-13306 * @param int|null $error_types */ function __construct($error_types = null) { $this->errors = array(); - $this->error_types = ($error_types !== null) ? $error_types : error_reporting(); + $this->error_types = $error_types; } function install() { - set_error_handler(array(&$this, 'error_handler'), $this->error_types); + set_error_handler(array(&$this, 'error_handler'), ($this->error_types !== null) ? $this->error_types : error_reporting()); } function uninstall() -- cgit v1.2.1