diff options
author | Serge Martin <edb@sigluy.net> | 2011-08-09 11:32:22 +0200 |
---|---|---|
committer | Serge Martin <edb@sigluy.net> | 2011-08-09 11:32:22 +0200 |
commit | 97462b018d7aae7bd6044bcb42d42c1b51171d5a (patch) | |
tree | b850ad237cee13ae4595da8661ab47bc3e44b459 /lib | |
parent | 8e3914bceb543bb8a8acba64e3e3adfdb06ca5d0 (diff) | |
download | nextcloud-server-97462b018d7aae7bd6044bcb42d42c1b51171d5a.tar.gz nextcloud-server-97462b018d7aae7bd6044bcb42d42c1b51171d5a.zip |
Merge MySQL and PostgreSQL input fields
Diffstat (limited to 'lib')
-rw-r--r-- | lib/setup.php | 45 |
1 files changed, 16 insertions, 29 deletions
diff --git a/lib/setup.php b/lib/setup.php index 04a65d01265..192fd134608 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -46,39 +46,26 @@ class OC_Setup { $error[] = 'STEP 2 : data directory path is not set.'; } - if($dbtype=='mysql') { //mysql needs more config options + if($dbtype=='mysql' or $dbtype=='pgsql') { //mysql and postgresql needs more config options + if($dbtype=='mysql') + $dbprettyname = 'MySQL'; + else + $dbprettyname = 'PostgreSQL'; + if(empty($options['dbuser'])) { - $error[] = 'STEP 3 : MySQL database user is not set.'; + $error[] = "STEP 3 : $dbprettyname database user is not set."; } if(empty($options['dbpass'])) { - $error[] = 'STEP 3 : MySQL database password is not set.'; + $error[] = "STEP 3 : $dbprettyname database password is not set."; } if(empty($options['dbname'])) { - $error[] = 'STEP 3 : MySQL database name is not set.'; + $error[] = "STEP 3 : $dbprettyname database name is not set."; } if(empty($options['dbhost'])) { - $error[] = 'STEP 3 : MySQL database host is not set.'; + $error[] = "STEP 3 : $dbprettyname database host is not set."; } if(!isset($options['dbtableprefix'])) { - $error[] = 'STEP 3 : MySQL database table prefix is not set.'; - } - } - - if($dbtype=='pgsql') { //postgresql needs more config options - if(empty($options['pg_dbuser'])) { - $error[] = 'STEP 3 : PostgreSQL database user is not set.'; - } - if(empty($options['pg_dbpass'])) { - $error[] = 'STEP 3 : PostgreSQL database password is not set.'; - } - if(empty($options['pg_dbname'])) { - $error[] = 'STEP 3 : PostgreSQL database name is not set.'; - } - if(empty($options['pg_dbhost'])) { - $error[] = 'STEP 3 : PostgreSQL database host is not set.'; - } - if(!isset($options['pg_dbtableprefix'])) { - $error[] = 'STEP 3 : PostgreSQL database table prefix is not set.'; + $error[] = "STEP 3 : $dbprettyname database table prefix is not set."; } } @@ -150,11 +137,11 @@ class OC_Setup { } } elseif($dbtype == 'pgsql') { - $dbuser = $options['pg_dbuser']; - $dbpass = $options['pg_dbpass']; - $dbname = $options['pg_dbname']; - $dbhost = $options['pg_dbhost']; - $dbtableprefix = $options['pg_dbtableprefix']; + $dbuser = $options['dbuser']; + $dbpass = $options['dbpass']; + $dbname = $options['dbname']; + $dbhost = $options['dbhost']; + $dbtableprefix = $options['dbtableprefix']; OC_CONFIG::setValue('dbname', $dbname); OC_CONFIG::setValue('dbhost', $dbhost); OC_CONFIG::setValue('dbtableprefix', $dbtableprefix); |