• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP error_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中error_string函数的典型用法代码示例。如果您正苦于以下问题:PHP error_string函数的具体用法?PHP error_string怎么用?PHP error_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了error_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: access_denied

function access_denied()
{
    if (!auth_is_user_authenticated()) {
        if (basename($_SERVER['SCRIPT_NAME']) != 'login_page.php') {
            $t_return_page = $_SERVER['PHP_SELF'];
            if (isset($_SERVER['QUERY_STRING'])) {
                $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
            }
            $t_return_page = string_url(string_sanitize_url($t_return_page));
            print_header_redirect('login_page.php?return=' . $t_return_page);
        }
    } else {
        if (auth_get_current_user_id() == user_get_id_by_name(config_get_global('anonymous_account'))) {
            if (basename($_SERVER['SCRIPT_NAME']) != 'login_page.php') {
                $t_return_page = $_SERVER['PHP_SELF'];
                if (isset($_SERVER['QUERY_STRING'])) {
                    $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
                }
                $t_return_page = string_url(string_sanitize_url($t_return_page));
                echo '<center>';
                echo '<p>' . error_string(ERROR_ACCESS_DENIED) . '</p>';
                print_bracket_link('login_page.php?return=' . $t_return_page, lang_get('click_to_login'));
                echo '<p></p>';
                print_bracket_link('main_page.php', lang_get('proceed'));
                echo '</center>';
            }
        } else {
            echo '<center>';
            echo '<p>' . error_string(ERROR_ACCESS_DENIED) . '</p>';
            print_bracket_link('main_page.php', lang_get('proceed'));
            echo '</center>';
        }
    }
    exit;
}
开发者ID:jin255ff,项目名称:company_website,代码行数:35,代码来源:access_api.php


示例2: check_print_error_rows

function check_print_error_rows()
{
    global $g_show_errors, $g_errors_temporarily_suppressed, $g_errors_raised;
    if (!$g_show_errors || $g_errors_temporarily_suppressed) {
        $g_errors_raised = array();
        return;
    }
    foreach ($g_errors_raised as $t_error) {
        # build an appropriate error string
        switch ($t_error['type']) {
            case E_WARNING:
                $t_error_type = 'SYSTEM WARNING';
                $t_error_description = htmlentities($t_error['error']);
                break;
            case E_NOTICE:
                $t_error_type = 'SYSTEM NOTICE';
                $t_error_description = htmlentities($t_error['error']);
                break;
            case E_USER_ERROR:
                $t_error_type = 'APPLICATION ERROR #' . $t_error['error'];
                $t_error_description = htmlentities(error_string($t_error['error']));
                break;
            case E_USER_WARNING:
                $t_error_type = 'APPLICATION WARNING #' . $t_error['error'];
                $t_error_description = htmlentities(error_string($t_error['error']));
                break;
            case E_USER_NOTICE:
                # used for debugging
                $t_error_type = 'DEBUG';
                $t_error_description = htmlentities($t_error['error']);
                break;
            default:
                # shouldn't happen, just display the error just in case
                $t_error_type = '';
                $t_error_description = htmlentities($t_error['error']);
        }
        echo "\t<tr>\n\t\t<td colspan=\"2\" class=\"error\">";
        echo "<strong>{$t_error_type}:</strong> {$t_error_description}<br />";
        echo '<em>Raised in file ' . htmlentities($t_error['file']) . ' on line ' . htmlentities($t_error['line']) . '</em>';
        echo "</td>\n\t</tr>\n";
    }
    $g_errors_raised = array();
}
开发者ID:nextgens,项目名称:mantisbt,代码行数:43,代码来源:check_api.php


示例3: json_error_handler

/**
 * JSON error handler
 * 
 * <p>Ensures that all necessary headers are set and terminates processing after being invoked.</p>
 */
function json_error_handler($p_type, $p_error, $p_file, $p_line, $p_context)
{
    # flush any language overrides to return to user's natural default
    if (function_exists('db_is_connected')) {
        if (db_is_connected()) {
            lang_push(lang_get_default());
        }
    }
    $t_error_code = ERROR_GENERIC;
    // default
    # build an appropriate error string
    switch ($p_type) {
        case E_WARNING:
            $t_error_type = 'SYSTEM WARNING';
            $t_error_description = $p_error;
            break;
        case E_NOTICE:
            $t_error_type = 'SYSTEM NOTICE';
            $t_error_description = $p_error;
            break;
        case E_USER_ERROR:
            $t_error_type = "APPLICATION ERROR #{$p_error}";
            $t_error_code = $p_error;
            $t_error_description = error_string($p_error);
            break;
        case E_USER_WARNING:
            $t_error_type = "APPLICATION WARNING #{$p_error}";
            $t_error_code = $p_error;
            $t_error_description = error_string($p_error);
            break;
        case E_USER_NOTICE:
            # used for debugging
            $t_error_type = 'DEBUG';
            $t_error_description = $p_error;
            break;
        default:
            #shouldn't happen, just display the error just in case
            $t_error_type = '';
            $t_error_description = $p_error;
    }
    json_output_raw(array('status' => 'ERROR', 'error' => array('code' => $t_error_code, 'type' => $t_error_type, 'message' => $t_error_description), 'contents' => $t_error_description));
}
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:47,代码来源:json_api.php


示例4: access_denied

function access_denied()
{
    if (!php_version_at_least('4.1.0')) {
        global $_SERVER;
    }
    if (!auth_is_user_authenticated()) {
        if (basename($_SERVER['SCRIPT_NAME']) != 'login_page.php') {
            if (!isset($_SERVER['REQUEST_URI'])) {
                if (!isset($_SERVER['QUERY_STRING'])) {
                    $_SERVER['QUERY_STRING'] = '';
                }
                $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
            }
            $t_return_page = string_url($_SERVER['REQUEST_URI']);
            print_header_redirect('login_page.php?return=' . $t_return_page);
        }
    } else {
        echo '<center>';
        echo '<p>' . error_string(ERROR_ACCESS_DENIED) . '</p>';
        print_bracket_link('main_page.php', lang_get('proceed'));
        echo '</center>';
    }
    exit;
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:24,代码来源:access_api.php


示例5: auth_http_prompt

/**
 *
 * @access public
 */
function auth_http_prompt()
{
    header('HTTP/1.0 401 Authorization Required');
    header('WWW-Authenticate: Basic realm="' . lang_get('http_auth_realm') . '"');
    header('status: 401 Unauthorized');
    echo '<center>';
    echo '<p>' . error_string(ERROR_ACCESS_DENIED) . '</p>';
    print_bracket_link('main_page.php', lang_get('proceed'));
    echo '</center>';
    exit;
}
开发者ID:kaos,项目名称:mantisbt,代码行数:15,代码来源:authentication_api.php


示例6: helper_alternate_class

?>
		</td>
	</tr>
	<tr <?php 
echo helper_alternate_class();
?>
 valign="top">
		<th class="category">
			<?php 
echo lang_get('realname');
?>
		</th>
		<td>
			<?php 
if (!($t_can_manage || $t_can_see_realname)) {
    print error_string(ERROR_ACCESS_DENIED);
} else {
    echo string_display_line($u_realname);
}
?>
		</td>
	</tr>
	<?php 
if ($t_can_manage) {
    ?>
	<tr>
		<td colspan="2" class="center">
			<?php 
    print_bracket_link('manage_user_edit_page.php?user_id=' . $f_user_id, lang_get('manage_user'));
    ?>
		</td>
开发者ID:kaos,项目名称:mantisbt,代码行数:31,代码来源:view_user_page.php


示例7: error_handler

/**
 * Default error handler
 *
 * This handler will not receive E_ERROR, E_PARSE, E_CORE_*, or E_COMPILE_*
 *  errors.
 *
 * E_USER_* are triggered by us and will contain an error constant in $p_error
 * The others, being system errors, will come with a string in $p_error
 *
 * @access private
 * @param integer $p_type    Contains the level of the error raised, as an integer.
 * @param string  $p_error   Contains the error message, as a string.
 * @param string  $p_file    Contains the filename that the error was raised in, as a string.
 * @param integer $p_line    Contains the line number the error was raised at, as an integer.
 * @param array   $p_context To the active symbol table at the point the error occurred (optional).
 * @return void
 * @uses lang_api.php
 * @uses config_api.php
 * @uses compress_api.php
 * @uses database_api.php (optional)
 * @uses html_api.php (optional)
 */
function error_handler($p_type, $p_error, $p_file, $p_line, array $p_context)
{
    global $g_error_parameters, $g_error_handled, $g_error_proceed_url;
    global $g_error_send_page_header;
    # check if errors were disabled with @ somewhere in this call chain
    if (0 == error_reporting()) {
        return;
    }
    $t_lang_pushed = false;
    $t_db_connected = false;
    if (function_exists('db_is_connected')) {
        if (db_is_connected()) {
            $t_db_connected = true;
        }
    }
    $t_html_api = false;
    if (function_exists('html_end')) {
        $t_html_api = true;
    }
    # flush any language overrides to return to user's natural default
    if ($t_db_connected) {
        lang_push(lang_get_default());
        $t_lang_pushed = true;
    }
    $t_method_array = config_get_global('display_errors');
    if (isset($t_method_array[$p_type])) {
        $t_method = $t_method_array[$p_type];
    } else {
        if (isset($t_method_array[E_ALL])) {
            $t_method = $t_method_array[E_ALL];
        } else {
            $t_method = 'none';
        }
    }
    # build an appropriate error string
    $t_error_location = 'in \'' . $p_file . '\' line ' . $p_line;
    $t_error_description = '\'' . $p_error . '\' ' . $t_error_location;
    switch ($p_type) {
        case E_WARNING:
            $t_error_type = 'SYSTEM WARNING';
            break;
        case E_NOTICE:
            $t_error_type = 'SYSTEM NOTICE';
            break;
        case E_STRICT:
            $t_error_type = 'STRICT NOTICE';
            break;
        case E_RECOVERABLE_ERROR:
            # This should generally be considered fatal (like E_ERROR)
            $t_error_type = 'SYSTEM ERROR';
            break;
        case E_DEPRECATED:
            $t_error_type = 'DEPRECATED';
            break;
        case E_USER_ERROR:
            $t_error_type = 'APPLICATION ERROR #' . $p_error;
            $t_error_description = error_string($p_error);
            if ($t_method == DISPLAY_ERROR_INLINE) {
                $t_error_description .= ' (' . $t_error_location . ")\n" . error_string(ERROR_DISPLAY_USER_ERROR_INLINE);
            }
            break;
        case E_USER_WARNING:
            $t_error_type = 'APPLICATION WARNING #' . $p_error;
            $t_error_description = error_string($p_error) . ' (' . $t_error_location . ')';
            break;
        case E_USER_NOTICE:
            # used for debugging
            $t_error_type = 'DEBUG';
            break;
        case E_USER_DEPRECATED:
            # Get the parent of the call that triggered the error to facilitate
            # debugging with a more useful filename and line number
            $t_stack = debug_backtrace();
            $t_caller = $t_stack[2];
            $t_error_type = 'WARNING';
            $t_error_description = error_string($p_error) . ' (in ' . $t_caller['file'] . ' line ' . $t_caller['line'] . ')';
            if ($t_method == DISPLAY_ERROR_INLINE && php_sapi_name() != 'cli') {
                # Enqueue messages for later display with error_print_delayed()
//.........这里部分代码省略.........
开发者ID:spring,项目名称:spring-website,代码行数:101,代码来源:error_api.php


示例8: error_handler

/**
 * Default error handler
 *
 * This handler will not receive E_ERROR, E_PARSE, E_CORE_*, or E_COMPILE_*
 *  errors.
 *
 * E_USER_* are triggered by us and will contain an error constant in $p_error
 * The others, being system errors, will come with a string in $p_error
 *
 * @access private
 * @param int p_type contains the level of the error raised, as an integer.
 * @param string p_error contains the error message, as a string.
 * @param string p_file contains the filename that the error was raised in, as a string.
 * @param int p_line contains the line number the error was raised at, as an integer.
 * @param array p_context to the active symbol table at the point the error occurred (optional)
 * @uses lang_api.php
 * @uses config_api.php
 * @uses compress_api.php
 * @uses database_api.php (optional)
 * @uses html_api.php (optional)
 */
function error_handler($p_type, $p_error, $p_file, $p_line, $p_context)
{
    global $g_error_parameters, $g_error_handled, $g_error_proceed_url;
    global $g_lang_overrides;
    global $g_error_send_page_header;
    # check if errors were disabled with @ somewhere in this call chain
    if (0 == error_reporting()) {
        return;
    }
    $t_lang_pushed = false;
    $t_db_connected = false;
    if (function_exists('db_is_connected')) {
        if (db_is_connected()) {
            $t_db_connected = true;
        }
    }
    $t_html_api = false;
    if (function_exists('html_end')) {
        $t_html_api = true;
    }
    # flush any language overrides to return to user's natural default
    if ($t_db_connected) {
        lang_push(lang_get_default());
        $t_lang_pushed = true;
    }
    $t_short_file = basename($p_file);
    $t_method_array = config_get_global('display_errors');
    if (isset($t_method_array[$p_type])) {
        $t_method = $t_method_array[$p_type];
    } else {
        if (isset($t_method_array[E_ALL])) {
            $t_method = $t_method_array[E_ALL];
        } else {
            $t_method = 'none';
        }
    }
    # build an appropriate error string
    switch ($p_type) {
        case E_WARNING:
            $t_error_type = 'SYSTEM WARNING';
            $t_error_description = "'{$p_error}' in '{$p_file}' line {$p_line}";
            break;
        case E_NOTICE:
            $t_error_type = 'SYSTEM NOTICE';
            $t_error_description = "'{$p_error}' in '{$p_file}' line {$p_line}";
            break;
        case E_USER_ERROR:
            $t_error_type = "APPLICATION ERROR #{$p_error}";
            $t_error_description = error_string($p_error);
            if ($t_method == DISPLAY_ERROR_INLINE) {
                $t_error_description .= "\n" . error_string(ERROR_DISPLAY_USER_ERROR_INLINE);
            }
            break;
        case E_USER_WARNING:
            $t_error_type = "APPLICATION WARNING #{$p_error}";
            $t_error_description = error_string($p_error);
            break;
        case E_USER_NOTICE:
            # used for debugging
            $t_error_type = 'DEBUG';
            $t_error_description = $p_error;
            break;
        default:
            # shouldn't happen, just display the error just in case
            $t_error_type = '';
            $t_error_description = $p_error;
    }
    $t_error_description = nl2br($t_error_description);
    switch ($t_method) {
        case DISPLAY_ERROR_HALT:
            # disable any further event callbacks
            if (function_exists('event_clear_callbacks')) {
                event_clear_callbacks();
            }
            $t_oblen = ob_get_length();
            if ($t_oblen > 0) {
                $t_old_contents = ob_get_contents();
                if (!error_handled()) {
                    # Retrieve the previously output header
//.........这里部分代码省略.........
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:101,代码来源:error_api.php


示例9: access_denied

/**
 * Function to be called when a user is attempting to access a page that
 * he/she is not authorised to.  This outputs an access denied message then
 * re-directs to the mainpage.
 */
function access_denied()
{
    if (!auth_is_user_authenticated()) {
        if (basename($_SERVER['SCRIPT_NAME']) != 'login_page.php') {
            $t_return_page = $_SERVER['SCRIPT_NAME'];
            if (isset($_SERVER['QUERY_STRING'])) {
                $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
            }
            $t_return_page = string_url(string_sanitize_url($t_return_page));
            print_header_redirect('login_page.php' . '?return=' . $t_return_page);
        }
    } else {
        if (current_user_is_anonymous()) {
            if (basename($_SERVER['SCRIPT_NAME']) != 'login_page.php') {
                $t_return_page = $_SERVER['SCRIPT_NAME'];
                if (isset($_SERVER['QUERY_STRING'])) {
                    $t_return_page .= '?' . $_SERVER['QUERY_STRING'];
                }
                $t_return_page = string_url(string_sanitize_url($t_return_page));
                echo '<p class="center">' . error_string(ERROR_ACCESS_DENIED) . '</p><p class="center">';
                print_bracket_link(helper_mantis_url('login_page.php') . '?return=' . $t_return_page, lang_get('click_to_login'));
                echo '</p><p class="center">';
                print_bracket_link(helper_mantis_url('main_page.php'), lang_get('proceed'));
                echo '</p>';
            }
        } else {
            echo '<p class="center">' . error_string(ERROR_ACCESS_DENIED) . '</p>';
            echo '<p class="center">';
            print_bracket_link(helper_mantis_url('main_page.php'), lang_get('proceed'));
            echo '</p>';
        }
    }
    exit;
}
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:39,代码来源:access_api.php


示例10: handle_error

function handle_error($errno, $errstr)
{
    throw new HTTPException(500, "Mantis encountered an error: " . error_string($errstr));
    $resp->send();
    exit;
}
开发者ID:ahmedmehdilaabidi,项目名称:mantis-rest,代码行数:6,代码来源:init.php


示例11: mc_error_handler

function mc_error_handler($p_type, $p_error, $p_file, $p_line, $p_context)
{
    global $g_error_parameters, $g_error_handled, $g_error_proceed_url;
    global $g_lang_overrides;
    global $g_error_send_page_header;
    global $l_oServer;
    # check if errors were disabled with @ somewhere in this call chain
    # also suppress php 5 strict warnings
    if (0 == error_reporting() || 2048 == $p_type) {
        return;
    }
    $t_lang_pushed = false;
    # flush any language overrides to return to user's natural default
    if (function_exists('db_is_connected')) {
        if (db_is_connected()) {
            lang_push(lang_get_default());
            $t_lang_pushed = true;
        }
    }
    $t_short_file = basename($p_file);
    $t_method_array = config_get('display_errors');
    if (isset($t_method_array[$p_type])) {
        $t_method = $t_method_array[$p_type];
    } else {
        $t_method = 'none';
    }
    # build an appropriate error string
    switch ($p_type) {
        case E_WARNING:
            $t_error_type = 'SYSTEM WARNING';
            $t_error_description = $p_error;
            break;
        case E_NOTICE:
            $t_error_type = 'SYSTEM NOTICE';
            $t_error_description = $p_error;
            break;
        case E_USER_ERROR:
            $t_error_type = "APPLICATION ERROR #{$p_error}";
            $t_error_description = error_string($p_error);
            break;
        case E_USER_WARNING:
            $t_error_type = "APPLICATION WARNING #{$p_error}";
            $t_error_description = error_string($p_error);
            break;
        case E_USER_NOTICE:
            # used for debugging
            $t_error_type = 'DEBUG';
            $t_error_description = $p_error;
            break;
        default:
            #shouldn't happen, just display the error just in case
            $t_error_type = '';
            $t_error_description = $p_error;
    }
    $t_error_description = $t_error_description;
    $t_error_stack = error_get_stack_trace();
    $l_oServer->fault('Server', "Error Type: {$t_error_type},\nError Description:\n{$t_error_description},\nStack Trace:\n{$t_error_stack}");
    $l_oServer->send_response();
    exit;
}
开发者ID:raultm,项目名称:mantisbt,代码行数:60,代码来源:mc_api.php


示例12: error_handler

/**
 * Default error handler
 *
 * This handler will not receive E_ERROR, E_PARSE, E_CORE_*, or E_COMPILE_*
 *  errors.
 *
 * E_USER_* are triggered by us and will contain an error constant in $p_error
 * The others, being system errors, will come with a string in $p_error
 *
 * @access private
 * @param int p_type contains the level of the error raised, as an integer.
 * @param string p_error contains the error message, as a string.
 * @param string p_file contains the filename that the error was raised in, as a string.
 * @param int p_line contains the line number the error was raised at, as an integer.
 * @param array p_context to the active symbol table at the point the error occurred (optional)
 * @uses lang_api.php
 * @uses config_api.php
 * @uses compress_api.php
 * @uses database_api.php (optional)
 * @uses html_api.php (optional)
 */
function error_handler($p_type, $p_error, $p_file, $p_line, $p_context)
{
    global $g_error_parameters, $g_error_handled, $g_error_proceed_url;
    global $g_lang_overrides;
    global $g_error_send_page_header;
    # check if errors were disabled with @ somewhere in this call chain
    if (0 == error_reporting()) {
        return;
    }
    $t_lang_pushed = false;
    $t_db_connected = false;
    if (function_exists('db_is_connected')) {
        if (db_is_connected()) {
            $t_db_connected = true;
        }
    }
    $t_html_api = false;
    if (function_exists('html_end')) {
        $t_html_api = true;
    }
    # flush any language overrides to return to user's natural default
    if ($t_db_connected) {
        lang_push(lang_get_default());
        $t_lang_pushed = true;
    }
    $t_short_file = basename($p_file);
    $t_method_array = config_get_global('display_errors');
    if (isset($t_method_array[$p_type])) {
        $t_method = $t_method_array[$p_type];
    } else {
        if (isset($t_method_array[E_ALL])) {
            $t_method = $t_method_array[E_ALL];
        } else {
            $t_method = 'none';
        }
    }
    # build an appropriate error string
    switch ($p_type) {
        case E_WARNING:
            $t_error_type = 'SYSTEM WARNING';
            $t_error_description = "'{$p_error}' in '{$p_file}' line {$p_line}";
            break;
        case E_NOTICE:
            $t_error_type = 'SYSTEM NOTICE';
            $t_error_description = "'{$p_error}' in '{$p_file}' line {$p_line}";
            break;
        case E_USER_ERROR:
            $t_error_type = "APPLICATION ERROR #{$p_error}";
            $t_error_description = error_string($p_error);
            break;
        case E_USER_WARNING:
            $t_error_type = "APPLICATION WARNING #{$p_error}";
            $t_error_description = error_string($p_error);
            break;
        case E_USER_NOTICE:
            # used for debugging
            $t_error_type = 'DEBUG';
            $t_error_description = $p_error;
            break;
        default:
            # shouldn't happen, just display the error just in case
            $t_error_type = '';
            $t_error_description = $p_error;
    }
    $t_error_description = nl2br($t_error_description);
    switch ($t_method) {
        case 'halt':
            # disable any further event callbacks
            if (function_exists('event_clear_callbacks')) {
                event_clear_callbacks();
            }
            $t_oblen = ob_get_length();
            if (error_handled() && $t_oblen > 0) {
                $t_old_contents = ob_get_contents();
            }
            # We need to ensure compression is off - otherwise the compression headers are output.
            compress_disable();
            # then clean the buffer, leaving output buffering on.
            if ($t_oblen > 0) {
//.........这里部分代码省略.........
开发者ID:rahmanjis,项目名称:dipstart-development,代码行数:101,代码来源:error_api.php


示例13: mc_error_handler

function mc_error_handler($p_type, $p_error, $p_file, $p_line, $p_context)
{
    global $l_oServer;
    # check if errors were disabled with @ somewhere in this call chain
    # also suppress php 5 strict warnings
    if (0 == error_reporting() || 2048 == $p_type) {
        return;
    }
    # flush any language overrides to return to user's natural default
    if (function_exists('db_is_connected')) {
        if (db_is_connected()) {
            lang_push(lang_get_default());
        }
    }
    # build an appropriate error string
    switch ($p_type) {
        case E_WARNING:
            $t_error_type = 'SYSTEM WARNING';
            $t_error_description = $p_error;
            break;
        case E_NOTICE:
            $t_error_type = 'SYSTEM NOTICE';
            $t_error_description = $p_error;
            break;
        case E_USER_ERROR:
            $t_error_type = "APPLICATION ERROR #{$p_error}";
            $t_error_description = error_string($p_error);
            break;
        case E_USER_WARNING:
            $t_error_type = "APPLICATION WARNING #{$p_error}";
            $t_error_description = error_string($p_error);
            break;
        case E_USER_NOTICE:
            # used for debugging
            $t_error_type = 'DEBUG';
            $t_error_description = $p_error;
            break;
        default:
            #shouldn't happen, just display the error just in case
            $t_error_type = '';
            $t_error_description = $p_error;
    }
    $t_error_stack = error_get_stack_trace();
    error_log("[mantisconnect.php] Error Type: {$t_error_type},\nError Description: {$t_error_description}\nStack Trace:\n{$t_error_stack}");
    $l_oServer->fault('Server', "Error Type: {$t_error_type},\nError Description: {$t_error_description}");
    $l_oServer->send_response();
    exit;
}
开发者ID:nourchene-benslimane,项目名称:mantisV0,代码行数:48,代码来源:mc_api.php


示例14: print_sql_error

function print_sql_error($p_query)
{
    global $g_administrator_email;
    print error_string(ERROR_SQL);
    print_email_link($g_administrator_email, lang_get('administrator'));
    print "<br />{$p_query};<br />";
}
开发者ID:jin255ff,项目名称:company_website,代码行数:7,代码来源:print_api.php


示例15: mc_error_handler

/**
 * Default error handler
 *
 * This handler will not receive E_ERROR, E_PARSE, E_CORE_*, or E_COMPILE_* errors.
 *
 * E_USER_* are triggered by us and will contain an error constant in $p_error
 * The others, being system errors, will come with a string in $p_error
 * @param integer $p_type    Contains the level of the error raised, as an integer.
 * @param string  $p_error   Contains the error message, as a string.
 * @param string  $p_file    Contains the filename that the error was raised in, as a string.
 * @param integer $p_line    Contains the line number the error was raised at, as an integer.
 * @param array   $p_context To the active symbol table at the point the error occurred (optional).
 * @return void
 */
function mc_error_handler($p_type, $p_error, $p_file, $p_line, array $p_context)
{
    # check if errors were disabled with @ somewhere in this call chain
    # also suppress php 5 strict warnings
    if (0 == error_reporting() || 2048 == $p_type) {
        return;
    }
    # flush any language overrides to return to user's natural default
    if (function_exists('db_is_connected')) {
        if (db_is_connected()) {
            lang_push(lang_get_default());
        }
    }
    # build an appropriate error string
    switch ($p_type) {
        case E_WARNING:
            $t_error_type = 'SYSTEM WARNING';
            $t_error_description = $p_error;
            break;
        case E_NOTICE:
            $t_error_type = 'SYSTEM NOTICE';
            $t_error_description = $p_error;
            break;
        case E_USER_ERROR:
            $t_error_type = 'APPLICATION ERROR #' . $p_error;
            $t_error_description = error_string($p_error);
            break;
        case E_USER_WARNING:
            $t_error_type = 'APPLICATION WARNING #' . $p_error;
            $t_error_description = error_string($p_error);
            break;
        case E_USER_NOTICE:
            # used for debugging
            $t_error_type = 'DEBUG';
            $t_error_description = $p_error;
            break;
        default:
            #shouldn't happen, just display the error just in case
            $t_error_type = '';
            $t_error_description = $p_error;
    }
    $t_error_stack = error_get_stack_trace();
    error_log('[mantisconnect.php] Error Type: ' . $t_error_type . ',' . "\n" . 'Error Description: ' . $t_error_description . "\n" . 'Stack Trace:' . "\n" . $t_error_stack);
    throw new SoapFault('Server', 'Error Type: ' . $t_error_type . ',' . "\n" . 'Error Description: ' . $t_error_description);
}
开发者ID:elmarculino,项目名称:mantisbt,代码行数:59,代码来源:mc_api.php


示例16: implode

# get user id
$t_user_id = $f_user_id;

$c_export = implode('',$t_prefs_arr);

# update preferences
$t_user_print_pref_table = db_get_table( 'user_print_pref' );
$query = "UPDATE $t_user_print_pref_table
		SET print_pref=" . db_param() . "
		WHERE user_id=" . db_param();

$result = db_query_bound( $query, Array( $c_export, $t_user_id ) );

form_security_purge( 'print_all_bug_options_update' );

html_page_top( null, $f_redirect_url );

echo '<br /><div>';

if ( $result ) {
	print lang_get( 'operation_successful' );
} else {
	print error_string( ERROR_GENERIC );
}

echo '<br />';
print_bracket_link( $f_redirect_url, lang_get( 'proceed' ) );
echo '<br /></div>';
html_page_bottom();
开发者ID:rombert,项目名称:mantisbt,代码行数:29,代码来源:print_all_bug_options_update.php


示例17: get_field_names

# get the fields list
$t_field_name_arr = get_field_names();
$field_name_count = count($t_field_name_arr);
# check the checkboxes
for ($i = 0; $i < $field_name_count; $i++) {
    $t_name = 'print_' . utf8_strtolower(str_replace(' ', '_', $t_field_name_arr[$i]));
    $t_flag = gpc_get($t_name, null);
    if ($t_flag === null) {
        $t_prefs_arr[$i] = 0;
    } else {
        $t_prefs_arr[$i] = 1;
    }
}
# get user id
$t_user_id = $f_user_id;
$c_export = implode('', $t_prefs_arr);
# update preferences
$t_user_print_pref_table = db_get_table('user_print_pref');
$query = "UPDATE {$t_user_print_pref_table}\n\t\tSET print_pref=" . db_param() . "\n\t\tWHERE user_id=" . db_param();
$result = db_query_bound($query, array($c_export, $t_user_id));
form_security_purge('print_all_bug_options_update');
html_page_top(null, $f_redirect_url);
if ($result) {
    html_operation_successful($f_redirect_url);
} else {
    echo '<div class="failure-msg">';
    print error_string(ERROR_GENERIC) . '<br />';
    print_bracket_link($f_redirect_url, lang_get('proceed'));
    echo '</div>';
}
html_page_bottom();
开发者ID:nextgens,项目名称:mantisbt,代码行数:31,代码来源:print_all_bug_options_update.php


示例18: print_sql_error

function print_sql_error($p_query)
{
    global $g_administrator_email;
    $error = error_string(ERROR_SQL);
    $error .= lang_get('word_separator');
    $error .= sprintf(lang_get('please_report'), prepare_email_link($g_administrator_email, lang_get('administrator')));
    $error .= "<br />{$p_query};<br />";
    echo $error;
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:9,代码来源:print_api.php


示例19: dirname

<?php

$GLOBALS['t_dir_emailreporting_adjust'] = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;
require_once $GLOBALS['t_dir_emailreporting_adjust'] . 'core.php';
$t_basename = 'EmailReporting';
$t_pagename = 'bug_report_mail';
if (plugin_needs_upgrade($g_plugin_cache[$t_basename])) {
    error_parameters($t_basename);
    echo error_string(ERROR_PLUGIN_UPGRADE_NEEDED);
    exit;
}
// This would work but skips some important checks done in plugin.php.
// For the moment this code will be disabled
/*
$t_pagename = 'pages/bug_report_mail.php';
plugin_push_current( $t_basename );
plugin_require_api( $t_pagename );
*/
$t_tmp_plugin_page = plugin_page($t_pagename, TRUE, $t_basename);
$t_tmp_plugin_page = explode('?', $t_tmp_plugin_page, 2);
$t_tmp_plugin_page[1] = explode('=', $t_tmp_plugin_page[1], 2);
$_GET[$t_tmp_plugin_page[1][0]] = $t_tmp_plugin_page[1][1];
require_once $GLOBALS['t_dir_emailreporting_adjust'] . $t_tmp_plugin_page[0];
开发者ID:mikemol,项目名称:EmailReporting,代码行数:23,代码来源:bug_report_mail.php


示例20: error_handler

function error_handler($p_type, $p_error, $p_file, $p_line, $p_context)
{
    global $g_error_parameters, $g_error_handled, $g_error_proceed_url;
    global $g_lang_overrides;
    global $g_error_send_page_header;
    # check if errors were disabled with @ somewhere in this call chain
    # also suppress php 5 strict warnings
    if (0 == error_reporting() || 2048 == $p_type) {
        return;
    }
    $t_lang_pushed = false;
    # flush any language overrides to return to user's natural default
    if (function_exists('db_is_connected')) {
        if (db_is_connected()) {
            lang_push(lang_get_default());
            $t_lang_pushed = true;
        }
    }
    $t_short_file = basename($p_file);
    $t_method_array = config_get('display_errors');
    if (isset($t_method_array[$p_type])) {
        $t_method = $t_method_array[$p_type];
    } else {
        $t_method = 'none';
    }
    # build an appropriate error string
    switch ($p_type) {
        case E_WARNING:
            $t_error_type = 'SYSTEM WARNING';
            $t_error_description = $p_error;
            break;
        case E_NOTICE:
            $t_error_type = 'SYSTEM NOTICE';
            $t_error_description = $p_error;
            break;
        case E_USER_ERROR:
            $t_error_type = "APPLICATION ERROR #{$p_error}";
            $t_error_description = error_string($p_error);
            break;
        case E_USER_WARNING:
            $t_error_type = "APPLICATION WARNING #{$p_error}";
            $t_error_description = error_string($p_error);
            break;
        case E_USER_NOTICE:
            # used for debugging
            $t_error_type = 'DEBUG';
            $t_error_description = $p_error;
            break;
        default:
            #shouldn't happen, just display the error just in case
            $t_error_type = '';
            $t_error_description = $p_error;
    }
    $t_error_description = nl2br($t_error_description);
    if ('halt' == $t_method) {
        $t_old_contents = ob_get_contents();
        # ob_end_clean() still seems to call the output handler which
        #  outputs the headers indicating compression. If we had
        #  PHP > 4.2.0 we could use ob_clean() instead but as it is
        #  we need to disable compression.
        compress_disable();
        if (ob_get_length()) {
            ob_end_clean();
        }
        # don't send the page header information if it has already been sent
        if ($g_error_send_page_header) {
            html_page_top1();
            if ($p_error != ERROR_DB_QUERY_FAILED) {
                html_page_top2();
            } else {
                html_page_top2a();
            }
        }
        print '<br /><div align="center"><table class="width50" cellspacing="1">';
        print "<tr><td class=\"form-title\">{$t_error_type}</td></tr>";
        print "<tr><td><p class=\"center\" style=\"color:red\">{$t_error_description}</p></td></tr>";
        print '<tr><td><p class="center">';
        if (null === $g_error_proceed_url) {
            print lang_get('error_no_proceed');
        } else {
            print "<a href=\"{$g_error_proceed_url}\">" . lang_get('proceed') . '</a>';
        }
        print '</p></td></tr>';
        if (ON == config_get('show_detailed_errors')) {
            print '<tr><td>';
            error_print_details($p_file, $p_line, $p_context);
            print '</td></tr>';
            print '<tr><td>';
            error_print_stack_trace();
            print '</td></tr>';
        }
        print '</table></div>';
        if ($g_error_handled && !is_blank($t_old_contents)) {
            print '<p>Previous non-fatal errors occurred.  Page contents follow.</p>';
            print '<div style="border: solid 1px black;padding: 4px">';
            print $t_old_contents;
            print '</div>';
        }
        if ($p_error != ERROR_DB_QUERY_FAILED) {
            html_page_bottom1();
//.........这里部分代码省略.........
开发者ID:amjadtbssm,项目名称:website,代码行数:101,代码来源:error_api.php



注:本文中的error_string函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP errorbox函数代码示例发布时间:2022-05-15
下一篇:
PHP error_reporting函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap