_db_error_page

  1. drupal
    1. drupal6
    2. drupal7 database.inc
Versionen
drupal6 – drupal7 _db_error_page($error = '')

Helper function to show fatal database errors.

Prints a themed maintenance page with the 'Site off-line' text, adding the provided error message in the case of 'display_errors' set to on. Ends the page request; no return.

Übergabeparameter

$error The error message to be appended if 'display_errors' is on.

Verwandte Themen

▾ 4 functions call _db_error_page()

db_connect in includes/database.pgsql.inc
Initialize a database connection.
db_connect in includes/database.mysql.inc
Initialize a database connection.
db_connect in includes/database.mysqli.inc
Initialise a database connection.
db_set_active in includes/database.inc
Activate a database for future queries.

Code

includes/database.inc, line 173

<?php
function _db_error_page($error = '') {
  global $db_type;
  drupal_init_language();
  drupal_maintenance_theme();
  drupal_set_header('HTTP/1.1 503 Service Unavailable');
  drupal_set_title('Site off-line');

  $message = '<p>The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.</p>';
  $message .= '<hr /><p><small>If you are the maintainer of this site, please check your database settings in the <code>settings.php</code> file and ensure that your hosting provider\'s database server is running. For more help, see the <a href="http://drupal.org/node/258">handbook</a>, or contact your hosting provider.</small></p>';

  if ($error && ini_get('display_errors')) {
    $message .= '<p><small>The ' . theme('placeholder', $db_type) . ' error was: ' . theme('placeholder', $error) . '.</small></p>';
  }

  print theme('maintenance_page', $message);
  exit;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen