Change default prefix if needed
This commit is contained in:
parent
89b521ccfe
commit
919523f2e2
@ -220,6 +220,12 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='')
|
|||||||
{
|
{
|
||||||
if ($sql)
|
if ($sql)
|
||||||
{
|
{
|
||||||
|
// Replace the prefix tables
|
||||||
|
if (MAIN_DB_PREFIX != 'llx_')
|
||||||
|
{
|
||||||
|
$sql=preg_replace('/llx_/i',MAIN_DB_PREFIX,$sql);
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($handler)) $sql=preg_replace('/__HANDLER__/i',"'".$handler."'",$sql);
|
if (!empty($handler)) $sql=preg_replace('/__HANDLER__/i',"'".$handler."'",$sql);
|
||||||
|
|
||||||
$newsql=preg_replace('/__ENTITY__/i',(!empty($entity)?$entity:$conf->entity),$sql);
|
$newsql=preg_replace('/__ENTITY__/i',(!empty($entity)?$entity:$conf->entity),$sql);
|
||||||
|
|||||||
@ -408,7 +408,7 @@ abstract class DolibarrModules
|
|||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."dolibarr_modules";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."dolibarr_modules";
|
||||||
$sql.= " WHERE numero = ".$this->numero;
|
$sql.= " WHERE numero = ".$this->numero;
|
||||||
$sql.= " AND entity in (0, ".$conf->entity.")";
|
$sql.= " AND entity IN (0, ".$conf->entity.")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::_dbunactive sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::_dbunactive sql=".$sql, LOG_DEBUG);
|
||||||
$this->db->query($sql);
|
$this->db->query($sql);
|
||||||
|
|||||||
@ -188,6 +188,12 @@ if ($action == "set")
|
|||||||
{
|
{
|
||||||
$buffer=preg_replace('/type=innodb/i','ENGINE=innodb',$buffer);
|
$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>";
|
//print "<tr><td>Creation de la table $name/td>";
|
||||||
$requestnb++;
|
$requestnb++;
|
||||||
@ -330,6 +336,12 @@ if ($action == "set")
|
|||||||
$buffer=trim($req);
|
$buffer=trim($req);
|
||||||
if ($buffer)
|
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>";
|
//print "<tr><td>Creation des cles et index de la table $name: '$buffer'</td>";
|
||||||
$requestnb++;
|
$requestnb++;
|
||||||
if ($conf->file->character_set_client == "UTF-8")
|
if ($conf->file->character_set_client == "UTF-8")
|
||||||
@ -538,6 +550,12 @@ if ($action == "set")
|
|||||||
// We loop on each requests
|
// We loop on each requests
|
||||||
foreach($arrayofrequests as $buffer)
|
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);
|
//dolibarr_install_syslog("Request: ".$buffer,LOG_DEBUG);
|
||||||
$resql=$db->query($buffer);
|
$resql=$db->query($buffer);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user