当前位置: 首页>>代码示例>>PHP>>正文


PHP db_is_connected函数代码示例

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


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

示例1: 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

示例2: config_delete

/**
 * delete the configuration entry
 *
 * @param string  $p_option  Configuration option.
 * @param integer $p_user    A user identifier.
 * @param integer $p_project A project identifier.
 * @return void
 */
function config_delete($p_option, $p_user = ALL_USERS, $p_project = ALL_PROJECTS)
{
    # bypass table lookup for certain options
    $t_bypass_lookup = !config_can_set_in_database($p_option);
    if (!$t_bypass_lookup && true === db_is_connected() && db_table_exists(db_get_table('config'))) {
        if (!config_can_delete($p_option)) {
            return;
        }
        $t_query = 'DELETE FROM {config}
				WHERE config_id = ' . db_param() . ' AND
					project_id=' . db_param() . ' AND
					user_id=' . db_param();
        db_query($t_query, array($p_option, $p_project, $p_user));
    }
    config_flush_cache($p_option, $p_user, $p_project);
}
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:24,代码来源:config_api.php

示例3: html_page_bottom1

function html_page_bottom1($p_file = null)
{
    if (!db_is_connected()) {
        return;
    }
    if (config_get('show_footer_menu')) {
        print '<br />';
        print_menu();
    }
    html_page_bottom1a($p_file);
}
开发者ID:amjadtbssm,项目名称:website,代码行数:11,代码来源:html_api.php

示例4: 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

示例5: auth_is_cookie_valid

/**
 * is cookie valid?
 * @param string $p_cookie_string
 * @return bool
 * @access public
 */
function auth_is_cookie_valid($p_cookie_string)
{
    global $g_cache_current_user_id;
    # fail if DB isn't accessible
    if (!db_is_connected()) {
        return false;
    }
    # fail if cookie is blank
    if ('' === $p_cookie_string) {
        return false;
    }
    # succeeed if user has already been authenticated
    if (null !== $g_cache_current_user_id) {
        return true;
    }
    if (user_search_cache('cookie_string', $p_cookie_string)) {
        return true;
    }
    # look up cookie in the database to see if it is valid
    $t_user_table = db_get_table('user');
    $query = "SELECT *\n\t\t\t\t  FROM {$t_user_table}\n\t\t\t\t  WHERE cookie_string=" . db_param();
    $result = db_query_bound($query, array($p_cookie_string));
    # return true if a matching cookie was found
    if (1 == db_num_rows($result)) {
        user_cache_database_result(db_fetch_array($result));
        return true;
    } else {
        return false;
    }
}
开发者ID:kaos,项目名称:mantisbt,代码行数:36,代码来源:authentication_api.php

示例6: config_delete

function config_delete( $p_option, $p_user = ALL_USERS, $p_project = ALL_PROJECTS ) {
	global $g_cache_config, $g_cache_config_access;

	# bypass table lookup for certain options
	$t_bypass_lookup = !config_can_set_in_database( $p_option );

	# @@ debug @@ if ($t_bypass_lookup) { echo "bp=$p_option match=$t_match_pattern <br />"; }
	# @@ debug @@ if ( ! db_is_connected() ) { echo "no db"; }

	if(( !$t_bypass_lookup ) && ( TRUE === db_is_connected() ) && ( db_table_exists( db_get_table( 'config' ) ) ) ) {
		if( !config_can_delete( $p_option ) ) {
			return;
		}

		$t_config_table = db_get_table( 'config' );

		# @@ debug @@ echo "lu table=" . ( db_table_exists( $t_config_table ) ? "yes" : "no" );
		# @@ debug @@ error_print_stack_trace();

		$c_user = db_prepare_int( $p_user );
		$c_project = db_prepare_int( $p_project );
		$query = "DELETE FROM $t_config_table
				WHERE config_id = " . db_param() . " AND
					project_id=" . db_param() . " AND
					user_id=" . db_param();

		$result = @db_query_bound( $query, Array( $p_option, $c_project, $c_user ) );
	}

	config_flush_cache( $p_option, $p_user, $p_project );
}
开发者ID:rombert,项目名称:mantisbt,代码行数:31,代码来源:config_api.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 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

示例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 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

示例9: config_get_global

?>
]
	</td>
	<?php 
$result = @db_connect(config_get_global('dsn', false), config_get_global('hostname'), config_get_global('db_username'), config_get_global('db_password'), config_get_global('database_name'));
if (false == $result) {
    print_test_result(BAD);
} else {
    print_test_result(GOOD);
}
?>
</tr>

<!-- Test DATABASE part 2 -->
<?php 
if (db_is_connected()) {
    $t_serverinfo = $g_db->ServerInfo();
    ?>
<tr>
	<td bgcolor="#ffffff">
		Database Type (adodb)
	</td>
	<td bgcolor="#ffffff">
			<?php 
    echo $g_db->databaseType;
    ?>
	</td>
</tr><tr>
	<td bgcolor="#ffffff">
			Database Provider (adodb)
	</td>
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:check.php

示例10: 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

示例11: config_delete

function config_delete($p_option, $p_user = ALL_USERS, $p_project = ALL_PROJECTS)
{
    global $g_cache_config, $g_cache_config_access;
    # bypass table lookup for certain options
    $t_bypass_lookup = !config_can_set_in_database($p_option);
    # @@ debug @@ if ($t_bypass_lookup) { echo "bp=$p_option match=$t_match_pattern <br />"; }
    # @@ debug @@ if ( ! db_is_connected() ) { echo "no db"; }
    if (!$t_bypass_lookup && TRUE === db_is_connected() && db_table_exists(config_get_global('mantis_config_table'))) {
        if (!config_can_delete($p_option)) {
            return;
        }
        $t_config_table = config_get_global('mantis_config_table');
        # @@ debug @@ echo "lu table=" . ( db_table_exists( $t_config_table ) ? "yes" : "no" );
        # @@ debug @@ error_print_stack_trace();
        $c_option = db_prepare_string($p_option);
        $c_user = db_prepare_int($p_user);
        $c_project = db_prepare_int($p_project);
        $query = "DELETE FROM {$t_config_table}\r\n\t\t\t\tWHERE config_id = '{$c_option}' AND\r\n\t\t\t\t\tproject_id={$c_project} AND\r\n\t\t\t\t\tuser_id={$c_user}";
        $result = @db_query($query);
    }
    config_flush_cache($p_option, $p_user, $p_project);
}
开发者ID:amjadtbssm,项目名称:website,代码行数:22,代码来源:config_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: auth_is_cookie_valid

function auth_is_cookie_valid($p_cookie_string)
{
    global $g_cache_current_user_id;
    # fail if DB isn't accessible
    if (!db_is_connected()) {
        return false;
    }
    # fail if cookie is blank
    if ('' === $p_cookie_string) {
        return false;
    }
    # succeeed if user has already been authenticated
    if (null !== $g_cache_current_user_id) {
        return true;
    }
    # look up cookie in the database to see if it is valid
    $t_user_table = config_get('mantis_user_table');
    $c_cookie_string = db_prepare_string($p_cookie_string);
    $query = "SELECT id\r\n\t\t\t\t  FROM {$t_user_table}\r\n\t\t\t\t  WHERE cookie_string='{$c_cookie_string}'";
    $result = db_query($query);
    # return true if a matching cookie was found
    return 1 == db_num_rows($result);
}
开发者ID:amjadtbssm,项目名称:website,代码行数:23,代码来源:authentication_api.php

示例15: print_test_row

?>
<table class="width75" align="center" cellspacing="1">
<tr>
<td class="form-title" width="30%" colspan="2"><?php 
echo 'Checking your installation';
?>
</td>
</tr>

<?php 
print_test_row('MantisBT requires at least <b>PHP ' . PHP_MIN_VERSION . '</b>. You are running <b>PHP ' . phpversion(), $result = version_compare(phpversion(), PHP_MIN_VERSION, '>='));
if (!print_test_row('Checking Config File Exists', file_exists($g_absolute_path . 'config_inc.php'), array(false => 'Please use install.php to perform initial installation <a href="install.php">Click here</a>'))) {
    die;
}
print_test_row('Opening connection to database [' . config_get_global('database_name') . '] on host [' . config_get_global('hostname') . '] with username [' . config_get_global('db_username') . ']', @db_connect(config_get_global('dsn', false), config_get_global('hostname'), config_get_global('db_username'), config_get_global('db_password'), config_get_global('database_name')) != false);
if (!db_is_connected()) {
    print_info_row('Database is not connected - Can not continue checks');
}
require_once 'obsolete.php';
if (isset($ADODB_vers)) {
    # ADOConnection::Version() is broken as it treats v5.1 the same as v5.10
    # Therefore we must extract the correct version ourselves
    # Upstream bug report: http://phplens.com/lens/lensforum/msgs.php?id=18320
    if (preg_match('/^[Vv]([0-9\\.]+)/', $ADODB_vers, $t_matches) == 1) {
        $t_adodb_version_check_ok = version_compare($t_matches[1], '5.10', '>=');
    }
}
print_test_warn_row('Checking adodb version...', $t_adodb_version_check_ok, $ADODB_vers);
print_test_row('Checking using bundled adodb with some drivers...', !(db_is_pgsql() || db_is_mssql() || db_is_db2()) || strstr($ADODB_vers, 'MantisBT Version') !== false);
$t_serverinfo = $g_db->ServerInfo();
print_info_row('Database Type (adodb)', $g_db->databaseType);
开发者ID:nourchene-benslimane,项目名称:mantisV0,代码行数:31,代码来源:check.php


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