]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
If cannot connect, then stop the installation
authorCraig Andrews <candrews@integralblue.com>
Sat, 25 Jul 2009 04:19:12 +0000 (00:19 -0400)
committerCraig Andrews <candrews@integralblue.com>
Sat, 25 Jul 2009 04:19:12 +0000 (00:19 -0400)
install.php

index d5e8e8b61f0864cefa3d8370418fc1ef6e0c9efb..901e502f1a2e45ca347db2292dd41006634e848d 100644 (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'));