diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-19 13:03:16 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-19 13:03:16 +0000 |
commit | 58bf1c792747cf7e6f3c291daf17563ed15e37cf (patch) | |
tree | ffaccd445f9927aa1f0ae02fb69a95f33d3475b2 /includes/database.pgsql.inc | |
parent | efb2419db30f930e6358a4c1ff40bca39866e5fe (diff) | |
download | brdo-58bf1c792747cf7e6f3c291daf17563ed15e37cf.tar.gz brdo-58bf1c792747cf7e6f3c291daf17563ed15e37cf.tar.bz2 |
#178523 by scor, JirkaRybka, keith.smith: user facing errors should contain text for users, not text for developers; still keeping some debug information, if display_errors is turned on on the server
Diffstat (limited to 'includes/database.pgsql.inc')
-rw-r--r-- | includes/database.pgsql.inc | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc index b4eb19dcd..7ee350049 100644 --- a/includes/database.pgsql.inc +++ b/includes/database.pgsql.inc @@ -47,11 +47,7 @@ function db_version() { function db_connect($url) { // Check if PostgreSQL support is present in PHP if (!function_exists('pg_connect')) { - drupal_maintenance_theme(); - drupal_set_title('PHP PostgreSQL support not enabled'); - print theme('maintenance_page', '<p>We were unable to use the PostgreSQL database because the PostgreSQL extension for PHP is not installed. Check your <code>PHP.ini</code> to see how you can enable it.</p> -<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>'); - exit; + _db_error_page('Unable to use the PostgreSQL database because the PostgreSQL extension for PHP is not installed. Check your <code>php.ini</code> to see how you can enable it.'); } $url = parse_url($url); @@ -82,21 +78,8 @@ function db_connect($url) { $connection = @pg_connect($conn_string); if (!$connection) { - drupal_maintenance_theme(); - drupal_set_header('HTTP/1.1 503 Service Unavailable'); - drupal_set_title('Unable to connect to database'); - print theme('maintenance_page', '<p>If you still have to install Drupal, proceed to the <a href="'. base_path() .'install.php">installation page</a>.</p> -<p>If you have already finished installing Drupal, this either means that the username and password information in your <code>settings.php</code> file is incorrect or that we can\'t connect to the PostgreSQL database server. This could mean your hosting provider\'s database server is down.</p> -<p>The PostgreSQL error was: '. theme('placeholder', decode_entities($php_errormsg)) .'</p> -<p>Currently, the database is '. theme('placeholder', substr($url['path'], 1)) .', the username is '. theme('placeholder', $url['user']) .', and the database server is '. theme('placeholder', $url['host']) .'.</p> -<ul> - <li>Are you sure you have the correct username and password?</li> - <li>Are you sure that you have typed the correct hostname?</li> - <li>Are you sure you have the correct database name?</li> - <li>Are you sure that the database server is running?</li> -</ul> -<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>'); - exit; + require_once './includes/unicode.inc'; + _db_error_page(decode_entities($php_errormsg)); } // Restore error tracking setting |