From 233c49f4b9fc90f5bd023420ed899439fb413db0 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 27 Oct 2014 12:51:26 +0100 Subject: Make supported DBs configurable within config.php This commit will make the supported DBs for installation configurable within config.php. By default the following databases are tested: "sqlite", "mysql", "pgsql". The reason behind this is that there might be instances where we want to prevent SQLite to be used by mistake. To test this play around with the new configuration parameter "supportedDatabases". --- lib/private/util.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib/private/util.php') diff --git a/lib/private/util.php b/lib/private/util.php index 858138f58fe..dd131e41310 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -436,12 +436,9 @@ class OC_Util { } $webServerRestart = false; - //check for database drivers - if (!(is_callable('sqlite_open') or class_exists('SQLite3')) - and !is_callable('mysql_connect') - and !is_callable('pg_connect') - and !is_callable('oci_connect') - ) { + $setup = new OC_Setup($config); + $availableDatabases = $setup->getSupportedDatabases(); + if (empty($availableDatabases)) { $errors[] = array( 'error' => $l->t('No database drivers (sqlite, mysql, or postgresql) installed.'), 'hint' => '' //TODO: sane hint -- cgit v1.2.3