| | 1532 | function dead_db() { |
|---|
| | 1533 | global $wpdb; |
|---|
| | 1534 | |
|---|
| | 1535 | // Load custom DB error template, if present. |
|---|
| | 1536 | if ( file_exists( ABSPATH . 'wp-content/db-error.php' ) ) { |
|---|
| | 1537 | require_once( ABSPATH . 'wp-content/db-error.php' ); |
|---|
| | 1538 | die(); |
|---|
| | 1539 | } |
|---|
| | 1540 | |
|---|
| | 1541 | // If installing or in the admin, provide the verbose message. |
|---|
| | 1542 | if ( defined('WP_INSTALLING') || defined('WP_ADMIN') ) |
|---|
| | 1543 | wp_die($wpdb->error); |
|---|
| | 1544 | |
|---|
| | 1545 | // Otherwise, be terse. |
|---|
| | 1546 | status_header( 500 ); |
|---|
| | 1547 | nocache_headers(); |
|---|
| | 1548 | header( 'Content-Type: text/html; charset=utf-8' ); |
|---|
| | 1549 | ?> |
|---|
| | 1550 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| | 1551 | <html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?>> |
|---|
| | 1552 | <head> |
|---|
| | 1553 | <title>Database Error</title> |
|---|
| | 1554 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| | 1555 | </head> |
|---|
| | 1556 | <body> |
|---|
| | 1557 | <h1>Error establishing a database connection</h1> |
|---|
| | 1558 | </body> |
|---|
| | 1559 | </html> |
|---|
| | 1560 | <?php |
|---|
| | 1561 | die(); |
|---|
| | 1562 | } |
|---|