GetInstance() public static method

获取单一实例
public static GetInstance ( ) : ZBlogException
return ZBlogException
Beispiel #1
0
function shutdown_error_handler()
{
    if ($error = error_get_last()) {
        if ($error['type'] == E_NOTICE) {
            return true;
        }
        if ($error['type'] == E_STRICT) {
            return true;
        }
        if (defined('E_DEPRECATED') && $error['type'] == E_DEPRECATED) {
            return true;
        }
        //ob_clean();
        $zbe = ZBlogException::GetInstance();
        $zbe->ParseShutdown($error);
        $zbe->Display();
        die;
    }
}
Beispiel #2
0
/**
 * 当机错误处理
 * @return bool
 */
function Debug_Shutdown_Handler()
{
    foreach ($GLOBALS['Filter_Plugin_Debug_Shutdown_Handler'] as $fpname => &$fpsignal) {
        $fpreturn = $fpname();
    }
    if ($error = error_get_last()) {
        $_SERVER['_error_count'] = $_SERVER['_error_count'] + 1;
        if (ZBlogException::$isdisable == true) {
            return true;
        }
        if (ZBlogException::$iswarning == false) {
            if ($error['type'] == E_WARNING) {
                return true;
            }
            if ($error['type'] == E_USER_WARNING) {
                return true;
            }
        }
        if (ZBlogException::$isstrict == false) {
            if ($error['type'] == E_NOTICE) {
                return true;
            }
            if ($error['type'] == E_STRICT) {
                return true;
            }
            if ($error['type'] == E_USER_NOTICE) {
                return true;
            }
        }
        if ($error['type'] == E_CORE_WARNING) {
            return true;
        }
        if ($error['type'] == E_COMPILE_WARNING) {
            return true;
        }
        if (defined('E_DEPRECATED') && $error['type'] == E_DEPRECATED) {
            return true;
        }
        if (defined('E_USER_DEPRECATED ') && $error['type'] == E_USER_DEPRECATED) {
            return true;
        }
        $zbe = ZBlogException::GetInstance();
        $zbe->ParseShutdown($error);
        $zbe->Display();
        die;
    }
}
Beispiel #3
0
/**
 * register_shutdown_function
 * @return true
 */
function api_shutdown_error_handler()
{
    if ($error = error_get_last()) {
        //ob_clean();
        $zbe = ZBlogException::GetInstance();
        $zbe->ParseShutdown($error);
        //Http500();
        api_format_exception($zbe);
    }
}