dead_db()

最后更新于:2021-11-25 23:24:00

dead_db()

Load custom DB error or display GeChiUI DB error.

源文件

文件: gc-includes/functions.php

function dead_db() {
	global $gcdb;

	gc_load_translations_early();

	// Load custom DB error template, if present.
	if ( file_exists( GC_CONTENT_DIR . '/db-error.php' ) ) {
		require_once GC_CONTENT_DIR . '/db-error.php';
		die();
	}

	// If installing or in the admin, provide the verbose message.
	if ( gc_installing() || defined( 'GC_ADMIN' ) ) {
		gc_die( $gcdb->error );
	}

	// Otherwise, be terse.
	gc_die( '<h1>' . __( 'Error establishing a database connection' ) . '</h1>', __( 'Database Error' ) );
}