]> source.dussan.org Git - nextcloud-server.git/commitdiff
use sqlite3 if sqlite2 isn't available
authorRobin Appelman <icewind1991@gmail.com>
Mon, 13 Jun 2011 21:18:39 +0000 (23:18 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Mon, 13 Jun 2011 23:20:41 +0000 (01:20 +0200)
lib/setup.php

index 72507f221b9f0ecf5f8bf6fe4f2e9b8ff0e8b2b8..ab4a786c4350ade6aced0802aebec590971decd7 100644 (file)
@@ -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
+?>