forked from GNUsocial/gnu-social
If cannot connect, then stop the installation
This commit is contained in:
parent
70cc09a5c2
commit
f86faaf341
@ -243,6 +243,12 @@ function pgsql_db_installer($host, $database, $username, $password, $sitename) {
|
|||||||
updateStatus("Checking database...");
|
updateStatus("Checking database...");
|
||||||
$conn = pg_connect($connstring);
|
$conn = pg_connect($connstring);
|
||||||
|
|
||||||
|
if ($conn ===false) {
|
||||||
|
updateStatus("Failed to connect to database: $connstring");
|
||||||
|
showForm();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//ensure database encoding is UTF8
|
//ensure database encoding is UTF8
|
||||||
$record = pg_fetch_object(pg_query($conn, 'SHOW server_encoding'));
|
$record = pg_fetch_object(pg_query($conn, 'SHOW server_encoding'));
|
||||||
if ($record->server_encoding != 'UTF8') {
|
if ($record->server_encoding != 'UTF8') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user