From 7645a6dc877fe577ce4a96b04a46ce2e8c839950 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Nov 2025 16:16:53 +0100 Subject: [PATCH] Debug v23 --- dev/build/generate_filelist_xml.php | 40 ++++++++++++++++++----------- htdocs/filefunc.inc.php | 2 +- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/dev/build/generate_filelist_xml.php b/dev/build/generate_filelist_xml.php index 87378a45b03..e5d6d8ba44a 100755 --- a/dev/build/generate_filelist_xml.php +++ b/dev/build/generate_filelist_xml.php @@ -37,6 +37,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit(1); } + +define('DOL_DOCUMENT_ROOT', dirname(dirname($path)).'/htdocs'); +define('NOREQUIREDB', 1); +define('NOREQUIREVIRTUALURL', 1); + require_once $path."../../htdocs/master.inc.php"; require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; @@ -461,24 +466,29 @@ if ($release) { if ($checklock) { print "Signature for unalterable files: ".$md5unalterable_files."\n"; + $lockedfile = DOL_DOCUMENT_ROOT.'/../dev/lockedfiles.txt'; $checksuminlockedfile = ''; - // Now we check the content of lockedfiles.txt - $arraylocked = file(DOL_DOCUMENT_ROOT.'/../dev/lockedfiles.txt'); - foreach ($arraylocked as $line) { - $tmparray = preg_split("/\s+/", $line, 3); - if ($tmparray[0] == $checklockmajorversion) { - $checksuminlockedfile = $tmparray[2]; + if (!file_exists($lockedfile)) { + print "Can't find the file ".$lockedfile.". No checksum to check\n"; + } else { + // Now we check the content of lockedfiles.txt + $arraylocked = file($lockedfile); + foreach ($arraylocked as $line) { + $tmparray = preg_split("/\s+/", $line, 3); + if ($tmparray[0] == $checklockmajorversion) { + $checksuminlockedfile = $tmparray[2]; + } } - } - if (empty($checksuminlockedfile)) { - print "The major version ".$checklockmajorversion." is not locked on the scope ".$checksource." (no entry found into dev/lockedfiles.txt).\n"; - } elseif ($checksuminlockedfile != $md5unalterable_files) { - print "The major version ".$checklockmajorversion." is locked on scope '".$checksource."' to checksum ".$checksuminlockedfile."\n"; - if ($checklockmajorversion != $checksource) { - print "The checksum now differs from the locked one, so we return an error.\n"; - print "\n"; - exit(10); + if (empty($checksuminlockedfile)) { + print "The major version ".$checklockmajorversion." is not locked on the scope ".$checksource." (file found but no matching entry found into dev/lockedfiles.txt).\n"; + } elseif ($checksuminlockedfile != $md5unalterable_files) { + print "The major version ".$checklockmajorversion." is locked on scope '".$checksource."' to checksum ".$checksuminlockedfile."\n"; + if ($checklockmajorversion != $checksource) { + print "The checksum now differs from the locked one, so we return an error.\n"; + print "\n"; + exit(10); + } } } } diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 9b1c0d64a67..77fddc79f44 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -316,7 +316,7 @@ if (empty($dolibarr_strict_mode)) { define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs) -if (empty($dolibarr_main_document_root) || !file_exists(DOL_DOCUMENT_ROOT."/core/lib/functions.lib.php")) { +if (empty(DOL_DOCUMENT_ROOT) || !file_exists(DOL_DOCUMENT_ROOT."/core/lib/functions.lib.php")) { print "Error: Dolibarr config file content seems to be not correctly defined"; if (empty($dolibarr_main_document_root)) { print " (dolibarr_main_document_root can't be known).
\n";