Change default prefix if needed

This commit is contained in:
Regis Houssin 2011-11-24 07:48:33 +01:00
parent 89b521ccfe
commit c64f16da1c

View File

@ -188,6 +188,12 @@ if ($action == "set")
{
$buffer=preg_replace('/type=innodb/i','ENGINE=innodb',$buffer);
}
// Replace the prefix tables
if ($dolibarr_main_db_prefix != 'llx_')
{
$buffer=preg_replace('/llx_/i',$dolibarr_main_db_prefix,$buffer);
}
//print "<tr><td>Creation de la table $name/td>";
$requestnb++;
@ -330,6 +336,12 @@ if ($action == "set")
$buffer=trim($req);
if ($buffer)
{
// Replace the prefix tables
if ($dolibarr_main_db_prefix != 'llx_')
{
$buffer=preg_replace('/llx_/i',$dolibarr_main_db_prefix,$buffer);
}
//print "<tr><td>Creation des cles et index de la table $name: '$buffer'</td>";
$requestnb++;
if ($conf->file->character_set_client == "UTF-8")
@ -538,6 +550,12 @@ if ($action == "set")
// We loop on each requests
foreach($arrayofrequests as $buffer)
{
// Replace the prefix tables
if ($dolibarr_main_db_prefix != 'llx_')
{
$buffer=preg_replace('/llx_/i',$dolibarr_main_db_prefix,$buffer);
}
//dolibarr_install_syslog("Request: ".$buffer,LOG_DEBUG);
$resql=$db->query($buffer);
if ($resql)