Advertisements

dead_db

Definition:
function dead_db() {}

Load custom DB error or display WordPress DB error.
If a file exists in the wp-content directory named db-error.php, then it will be loaded instead of displaying the WordPress DB error. If it is not found, then the WordPress DB error will be displayed instead.

Source code

function dead_db() {

	global $wpdb;



	// Load custom DB error template, if present.

	if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {

		require_once( WP_CONTENT_DIR . '/db-error.php' );

		die();

	}



	// If installing or in the admin, provide the verbose message.

	if ( defined('WP_INSTALLING') || defined('WP_ADMIN') )

		wp_die($wpdb->error);



	// Otherwise, be terse.

	status_header( 500 );

	nocache_headers();

	header( 'Content-Type: text/html; charset=utf-8' );

?>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<title><?php echo /*WP_I18N_DB_ERROR*/'Database Error'/*/WP_I18N_DB_ERROR*/; ?></title>



</head>

<body>

	<h1><?php echo /*WP_I18N_DB_CONNECTION_ERROR*/'Error establishing a database connection'/*/WP_I18N_DB_CONNECTION_ERROR*/; ?></h1>

</body>

</html>

<?php

	die();

}

770

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: