forked from verdnatura/hedera-web
35 lines
621 B
PHP
35 lines
621 B
PHP
|
<?php
|
||
|
|
||
|
class Error
|
||
|
{
|
||
|
static $logPhp = TRUE;
|
||
|
static $handler = NULL;
|
||
|
|
||
|
static function trigger ($domain, $code, $message)
|
||
|
{
|
||
|
if (self::$handler != NULL)
|
||
|
call_user_func (self::$handler, $domain, $code, $message);
|
||
|
// else
|
||
|
// trigger_error ($str, E_USER_WARNING);
|
||
|
}
|
||
|
|
||
|
static function logPhp ($enable)
|
||
|
{
|
||
|
self::$logPhp = $enable;
|
||
|
}
|
||
|
|
||
|
static function phpHandler ($code, $message, $file, $line, $context)
|
||
|
{
|
||
|
// if (self::$logPhp)
|
||
|
// Error::trigger ('PHP', $code, $message);
|
||
|
}
|
||
|
|
||
|
static function setHandler ($handler)
|
||
|
{
|
||
|
self::$handler = $handler;
|
||
|
set_error_handler ('Error::phpHandler', E_ALL);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|