Fixed issue with change of DATA_SOURCE_SQL_TYPE to DATA_SOURCE_DB_TYPE

This commit is contained in:
Rooty 2021-04-21 21:03:23 +02:00
parent 2a1359e06a
commit 79e84c4f86
2 changed files with 16 additions and 16 deletions

View File

@ -151,7 +151,7 @@ var $dbUninstallFile= "uninstall";
$sourcepath=$GLOBALS["CONF_DATA_PATH"]."data/upload/install/package/".$this->pkgName."/";
$checkBd=0;
//Vérification de l'existence d'un fichier BD pour la base de données courante
if (file_exists($sourcepath."install.".DATA_SOURCE_SQL_TYPE.".sql"))
if (file_exists($sourcepath."install.".DATA_SOURCE_DB_TYPE.".sql"))
{
$checkBd=1;
}
@ -180,10 +180,10 @@ var $dbUninstallFile= "uninstall";
if ($checkBd==1)
{
//Affichage du fichier sql dans une div
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("BLOCBD.ficBD",$sourcepath."install.".DATA_SOURCE_SQL_TYPE.".sql");
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("BLOCBD.typeBD", DATA_SOURCE_SQL_TYPE);
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("BLOCBD.ficBD",$sourcepath."install.".DATA_SOURCE_DB_TYPE.".sql");
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("BLOCBD.typeBD", DATA_SOURCE_DB_TYPE);
//Lecture du fichier et affichage du contenu
$fichier=new File($sourcepath."install.".DATA_SOURCE_SQL_TYPE.".sql");
$fichier=new File($sourcepath."install.".DATA_SOURCE_DB_TYPE.".sql");
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("BLOCBD.scriptBD",str_replace("\n", "<br/>", $fichier->readAll()));
$fichier->close();
}else if($checkBd==2){
@ -394,12 +394,12 @@ var $dbUninstallFile= "uninstall";
}
//Création BD
if (file_exists($sourcepath.$this->dbInstallFile.".". DATA_SOURCE_SQL_TYPE .".sql"))
if (file_exists($sourcepath.$this->dbInstallFile.".". DATA_SOURCE_DB_TYPE .".sql"))
{
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("TABLEBD.BLOCBD.nomficDB",$this->dbInstallFile.".". DATA_SOURCE_SQL_TYPE .".sql" );
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("TABLEBD.BLOCBD.nomficDB",$this->dbInstallFile.".". DATA_SOURCE_DB_TYPE .".sql" );
//Execution du script de création de la bd
if ($backup->restorebackUpDB($sourcepath,$this->dbInstallFile.".". DATA_SOURCE_SQL_TYPE .".sql"))
if ($backup->restorebackUpDB($sourcepath,$this->dbInstallFile.".". DATA_SOURCE_DB_TYPE .".sql"))
{
$GLOBALS["SYSTEM_TEMPLATE"]-> MxAttribut("TABLEBD.BLOCBD.class", "lnColor3");
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("TABLEBD.BLOCBD.statutDB", getMessage("SuccessBD"));
@ -481,7 +481,7 @@ var $dbUninstallFile= "uninstall";
$sourcepath=$GLOBALS["CONF_DATA_PATH"]."data/upload/install/package/".$this->pkgName."/";
$checkBd=0;
//Vérification de l'existence d'un fichier BD pour la base de données courante
if (file_exists($sourcepath."uninstall.".DATA_SOURCE_SQL_TYPE.".sql"))
if (file_exists($sourcepath."uninstall.".DATA_SOURCE_DB_TYPE.".sql"))
{
$checkBd=1;
}
@ -510,10 +510,10 @@ var $dbUninstallFile= "uninstall";
if ($checkBd==1)
{
//Affichage du fichier sql dans une div
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("ficBD",$sourcepath."uninstall.".DATA_SOURCE_SQL_TYPE.".sql");
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("typeBD", DATA_SOURCE_SQL_TYPE);
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("ficBD",$sourcepath."uninstall.".DATA_SOURCE_DB_TYPE.".sql");
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("typeBD", DATA_SOURCE_DB_TYPE);
//Lecture du fichier et affichage du contenu
$fichier=new File($sourcepath."uninstall.".DATA_SOURCE_SQL_TYPE.".sql");
$fichier=new File($sourcepath."uninstall.".DATA_SOURCE_DB_TYPE.".sql");
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("scriptBD",str_replace("\n", "<br/>", $fichier->readAll()));
$fichier->close();
}else if($checkBd==2){
@ -782,11 +782,11 @@ var $dbUninstallFile= "uninstall";
}
//Suppression de la base de données BD
if (file_exists($sourcepath.$this->dbUninstallFile.".". DATA_SOURCE_SQL_TYPE .".sql"))
if (file_exists($sourcepath.$this->dbUninstallFile.".". DATA_SOURCE_DB_TYPE .".sql"))
{
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("BLOCBD.nomficDB",$this->dbUninstallFile.".". DATA_SOURCE_SQL_TYPE .".sql" );
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("BLOCBD.nomficDB",$this->dbUninstallFile.".". DATA_SOURCE_DB_TYPE .".sql" );
//Execution du script de création de la bd
if ($backup->restorebackUpDB($sourcepath,$this->dbUninstallFile.".". DATA_SOURCE_SQL_TYPE .".sql"))
if ($backup->restorebackUpDB($sourcepath,$this->dbUninstallFile.".". DATA_SOURCE_DB_TYPE .".sql"))
{
$GLOBALS["SYSTEM_TEMPLATE"]-> MxAttribut("BLOCBD.class", "lnColor3");
$GLOBALS["SYSTEM_TEMPLATE"]-> MxText("BLOCBD.statutDB", getMessage("SuccessEraseBD"));

View File

@ -147,8 +147,8 @@ class BackupDb
* @return booleen
*/
function restoreBackUpDb($chemin,$nom_fichier){
if (defined("DATA_SOURCE_SQL_TYPE")){
return BackupDb::restore(DATA_SOURCE_SQL_TYPE, DATA_SOURCE_SQL_SERVER, DATA_SOURCE_SQL_USER, DATA_SOURCE_SQL_PASSWORD,$chemin,$nom_fichier, DATA_SOURCE_SQL_DATABASE);
if (defined("DATA_SOURCE_DB_TYPE")){
return BackupDb::restore(DATA_SOURCE_DB_TYPE, DATA_SOURCE_SQL_SERVER, DATA_SOURCE_SQL_USER, DATA_SOURCE_SQL_PASSWORD,$chemin,$nom_fichier, DATA_SOURCE_SQL_DATABASE);
}else{
return false;
}