diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-06-13 23:18:39 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-06-14 01:20:41 +0200 |
commit | f863002e95e864939923e286ba18e7adfbb786e7 (patch) | |
tree | a84424b135ba7f1b5159d27a756f373928ab268f | |
parent | 1e0fe05bef4a935c23d290ebda67059679da629f (diff) | |
download | nextcloud-server-f863002e95e864939923e286ba18e7adfbb786e7.tar.gz nextcloud-server-f863002e95e864939923e286ba18e7adfbb786e7.zip |
use sqlite3 if sqlite2 isn't available
-rw-r--r-- | lib/setup.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/setup.php b/lib/setup.php index 72507f221b9..ab4a786c435 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -1,6 +1,6 @@ <?php -$hasSQLite = is_callable('sqlite_open'); +$hasSQLite = (is_callable('sqlite_open') or class_exists('SQLite3')); $hasMySQL = is_callable('mysql_connect'); $datadir = OC_CONFIG::getValue('datadir', $SERVERROOT.'/data'); $opts = array( @@ -65,10 +65,15 @@ class OC_SETUP { $username = htmlspecialchars_decode($options['adminlogin']); $password = htmlspecialchars_decode($options['adminpass']); $datadir = htmlspecialchars_decode($options['directory']); + + //if only sqlite3 is available use that. + if($dbtype=='sqlite' and !is_callable('sqlite_open')){ + $dbtype='sqlite3'; + } //write the config file OC_CONFIG::setValue('datadirectory', $datadir); - OC_CONFIG::setValue('dbtype', $dbtype); + OC_CONFIG::setValue('dbtype', $dbtype); if($dbtype == 'mysql') { $dbuser = $options['dbuser']; $dbpass = $options['dbpass']; @@ -178,4 +183,4 @@ class OC_SETUP { } } -?>
\ No newline at end of file +?> |