From f4a41d0b58c01652266ae71c232feac082677bcb Mon Sep 17 00:00:00 2001 From: shish Date: Wed, 24 Oct 2007 18:16:54 +0000 Subject: [PATCH] Separate database support error from table creation error; give a more appropriate message when the database isn't supported git-svn-id: file:///home/shish/svn/shimmie2/trunk@566 7f39781d-f577-437e-ae19-be835c7a54ca --- install.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/install.php b/install.php index 0b21b124..378fc488 100644 --- a/install.php +++ b/install.php @@ -163,13 +163,21 @@ function create_tables($dsn) { // {{{ die("Couldn't connect to \"$dsn\""); } else { - if((substr($dsn, 0, 5) == "mysql") && create_tables_mysql($db)) { - $_SESSION['tables_created'] = true; + if(substr($dsn, 0, 5) == "mysql") { + if(create_tables_mysql($db)) { + $_SESSION['tables_created'] = true; + } } - else if((substr($dsn, 0, 5) == "pgsql" || substr($dsn, 0, 8) == "postgres") && create_tables_pgsql($db)) { - $_SESSION['tables_created'] = true; + else if(substr($dsn, 0, 5) == "pgsql" || substr($dsn, 0, 8) == "postgres") { + if(create_tables_pgsql($db)) { + $_SESSION['tables_created'] = true; + } } else { + die("This database format isn't currently supported. Please use either MySQL or PostgreSQL."); + } + + if(!isset($_SESSION['tables_created']) || !$_SESSION['tables_created']) { die("Error creating tables"); } }