mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/13306] constructor sets error types
https://tracker.phpbb.com/browse/PHPBB3-13306 PHPBB3-13306
This commit is contained in:
parent
a143a19b8b
commit
efd4b43c1b
1 changed files with 14 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue