If cannot connect, then stop the installation

This commit is contained in:
Craig Andrews 2009-07-25 00:19:12 -04:00
parent 70cc09a5c2
commit f86faaf341
1 changed files with 6 additions and 0 deletions

View File

@ -242,6 +242,12 @@ function pgsql_db_installer($host, $database, $username, $password, $sitename) {
updateStatus("Starting installation...");
updateStatus("Checking database...");
$conn = pg_connect($connstring);
if ($conn ===false) {
updateStatus("Failed to connect to database: $connstring");
showForm();
return false;
}
//ensure database encoding is UTF8
$record = pg_fetch_object(pg_query($conn, 'SHOW server_encoding'));