Fix custom database names
This commit is contained in:
parent
9fe7f992d9
commit
581328fbc1
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||||
<database>
|
<database>
|
||||||
|
|
||||||
<name>owncloud</name>
|
<name>*dbname*</name>
|
||||||
<create>true</create>
|
<create>true</create>
|
||||||
<overwrite>false</overwrite>
|
<overwrite>false</overwrite>
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
<name>groups</name>
|
<name>*dbprefix*groups</name>
|
||||||
|
|
||||||
<declaration>
|
<declaration>
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
<name>locks</name>
|
<name>*dbprefix*locks</name>
|
||||||
|
|
||||||
<declaration>
|
<declaration>
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
<name>log</name>
|
<name>*dbprefix*log</name>
|
||||||
|
|
||||||
<declaration>
|
<declaration>
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
<name>properties</name>
|
<name>*dbprefix*properties</name>
|
||||||
|
|
||||||
<declaration>
|
<declaration>
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
<name>user_group</name>
|
<name>*dbprefix*user_group</name>
|
||||||
|
|
||||||
<declaration>
|
<declaration>
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
||||||
<name>users</name>
|
<name>*dbprefix*users</name>
|
||||||
|
|
||||||
<declaration>
|
<declaration>
|
||||||
|
|
||||||
|
|
|
@ -530,7 +530,17 @@ class OC_DB {
|
||||||
|
|
||||||
static function createDBFromStructure($file){
|
static function createDBFromStructure($file){
|
||||||
OC_DB::connect();
|
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){
|
if($definition instanceof MDB2_Schema_Error){
|
||||||
die($definition->getMessage() . ': ' . $definition->getUserInfo());
|
die($definition->getMessage() . ': ' . $definition->getUserInfo());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue