public static function shutdown_handler($errors = false, $handled = false)
    {
        if ($handled) {
            self::flush();
        }

        if ($errors === true && ($error = error_get_last()) && !$handled) {
            self::error_handler($error["type"], $error["message"], $error["file"], $error["line"]);
        }

        if (!$handled) {
            self::flush();
        }

        if (session_id() != '') {
            session_write_close();
        }

        exit;
    }