Debug v22

This commit is contained in:
ldestailleur 2025-06-18 14:24:51 +02:00
parent 3d3cf00cef
commit 8ef8891581

View file

@ -197,6 +197,8 @@ class Website extends CommonObject
return -1;
}
$pathofwebsite = $conf->website->dir_output.'/'.$this->ref;
// Insert request
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element.'(';
$sql .= 'entity,';
@ -254,8 +256,6 @@ class Website extends CommonObject
dol_mkdir($conf->medias->multidir_output[$conf->entity].'/image/'.$this->ref, DOL_DATA_ROOT);
dol_mkdir($conf->medias->multidir_output[$conf->entity].'/js/'.$this->ref, DOL_DATA_ROOT);
$pathofwebsite = $conf->website->dir_output.'/'.$this->ref;
// Check symlink documents/website/mywebsite/medias to point to documents/medias and restore it if ko.
// Recreate also dir of website if not found.
$pathtomedias = DOL_DATA_ROOT.'/medias';
@ -284,12 +284,12 @@ class Website extends CommonObject
$stringtodolibarrfile .= "param=value\n";
//print $conf->website->dir_output.'/'.$this->ref.'/.dolibarr';exit;
file_put_contents($pathofwebsite.'/.dolibarr', $stringtodolibarrfile);
}
$filelicense = $pathofwebsite.'/LICENSE';
if (!dol_is_file($filelicense)) {
$licensecontent = "LICENSE\n-------\nThis website template content (HTML and PHP code) is published under the license CC-BY-SA - https://creativecommons.org/licenses/by/4.0/";
$result = dolSaveLicense($filelicense, $licensecontent);
$filelicense = $pathofwebsite.'/LICENSE';
if (!dol_is_file($filelicense)) {
$licensecontent = "LICENSE\n-------\nThis website template content (HTML and PHP code) is published under the license CC-BY-SA - https://creativecommons.org/licenses/by/4.0/";
$result = dolSaveLicense($filelicense, $licensecontent);
}
}
// Commit or rollback