diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-04-17 11:59:15 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-04-17 11:59:15 +0200 |
commit | ab155de14fbc046d78b4eeaac0e8350c4b38dc98 (patch) | |
tree | 16af794163a6d8dbe154e68295dca9a7c7560c49 /lib/database.php | |
parent | fda445ab0536b06f8bb37b58413a25d97f4036a5 (diff) | |
download | nextcloud-server-ab155de14fbc046d78b4eeaac0e8350c4b38dc98.tar.gz nextcloud-server-ab155de14fbc046d78b4eeaac0e8350c4b38dc98.zip |
improve error handeling for first run dialog
Diffstat (limited to 'lib/database.php')
-rw-r--r-- | lib/database.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/database.php b/lib/database.php index 970e43c1227..97651ccf50a 100644 --- a/lib/database.php +++ b/lib/database.php @@ -239,7 +239,7 @@ class OC_DB { // read file $content = file_get_contents( $file ); - + // Make changes and save them to a temporary file $file2 = tempnam( sys_get_temp_dir(), 'oc_db_scheme_' ); $content = str_replace( '*dbname*', $CONFIG_DBNAME, $content ); @@ -247,8 +247,8 @@ class OC_DB { file_put_contents( $file2, $content ); // Try to create tables - $definition = @self::$schema->parseDatabaseDefinitionFile( $file2 ); - + $definition = self::$schema->parseDatabaseDefinitionFile( $file2 ); + // Delete our temporary file unlink( $file2 ); @@ -256,7 +256,10 @@ class OC_DB { if( $definition instanceof MDB2_Schema_Error ){ die( $definition->getMessage().': '.$definition->getUserInfo()); } - $ret=@self::$schema->createDatabase( $definition ); + if(OC_CONFIG::getValue('dbtype','sqlite')=='sqlite'){ + $definition['overwrite']=true;//always overwrite for sqlite + } + $ret=self::$schema->createDatabase( $definition ); // Die in case something went wrong if( $ret instanceof MDB2_Error ){ |