diff --git a/db_structure.xml b/db_structure.xml index f5d0f24505e..7efb722bd72 100755 --- a/db_structure.xml +++ b/db_structure.xml @@ -1,7 +1,7 @@ - owncloud + *dbname* true false @@ -9,7 +9,7 @@ - groups + *dbprefix*groups @@ -45,7 +45,7 @@
- locks + *dbprefix*locks @@ -173,7 +173,7 @@
- log + *dbprefix*log @@ -224,7 +224,7 @@
- properties + *dbprefix*properties @@ -289,7 +289,7 @@
- user_group + *dbprefix*user_group @@ -324,7 +324,7 @@
- users + *dbprefix*users diff --git a/inc/lib_base.php b/inc/lib_base.php index 67dbcb2eac9..5c9906d361d 100755 --- a/inc/lib_base.php +++ b/inc/lib_base.php @@ -530,7 +530,17 @@ class OC_DB { static function createDBFromStructure($file){ OC_DB::connect(); - $definition=@self::$schema->parseDatabaseDefinitionFile($file); + global $CONFIG_DBNAME; + global $CONFIG_DBTABLEPREFIX; + $content=file_get_contents($file); + $file2=tempnam(sys_get_temp_dir(),'oc_db_scheme_'); + echo $content; + $content=str_replace('*dbname*',$CONFIG_DBNAME,$content); + $content=str_replace('*dbprefix*',$CONFIG_DBTABLEPREFIX,$content); + echo $content; + file_put_contents($file2,$content); + $definition=@self::$schema->parseDatabaseDefinitionFile($file2); + unlink($file2); if($definition instanceof MDB2_Schema_Error){ die($definition->getMessage() . ': ' . $definition->getUserInfo()); }