Fix sqlite version detection

This commit is contained in:
Tom Needham 2012-04-08 18:52:31 +00:00
parent 5e314e8eff
commit e5ebbacc9e
1 changed files with 7 additions and 3 deletions

View File

@ -496,7 +496,11 @@ class OC_Migrate{
$datadir = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ); $datadir = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
// DB type // DB type
if( !is_callable( 'sqlite_open' ) || !class_exists( 'SQLite3' ) ){ if( class_exists( 'SQLite3' ) ){
$dbtype = 'sqlite3';
} else if( is_callable( 'sqlite_open' ) ){
$dbtype = 'sqlite';
} else {
OC_Log::write( 'migration', 'SQLite not found', OC_Log::ERROR ); OC_Log::write( 'migration', 'SQLite not found', OC_Log::ERROR );
return false; return false;
} }
@ -510,7 +514,7 @@ class OC_Migrate{
'quote_identifier' => true 'quote_identifier' => true
); );
$dsn = array( $dsn = array(
'phptype' => 'sqlite3', 'phptype' => $dbtype,
'database' => self::$dbpath, 'database' => self::$dbpath,
'mode' => '0644' 'mode' => '0644'
); );