N°3007 - Warn the user that installing a patch on a non conform install is not recommended

This commit is contained in:
Eric
2020-06-04 10:38:58 +02:00
parent 8064a20718
commit 9d8a7bf561
6 changed files with 99 additions and 12 deletions

View File

@@ -25,7 +25,7 @@ class FilesIntegrity
* @return array|false list of file info (path, size, md5)
* @throws \Exception
*/
private static function GetInstalledFiles($sManifest)
public static function GetInstalledFiles($sManifest)
{
$aFiles = array();
@@ -54,14 +54,19 @@ class FilesIntegrity
if ($oFileNode->hasChildNodes())
{
$aFileInfo = array();
$sFilePath = uniqid(); // just in case no path...
foreach ($oFileNode->childNodes as $oFileInfo)
{
if ($oFileInfo instanceof DOMElement)
{
$aFileInfo[$oFileInfo->tagName] = $oFileInfo->textContent;
if ($oFileInfo->tagName == 'path')
{
$sFilePath = $oFileInfo->textContent;
}
}
}
$aFiles[] = $aFileInfo;
$aFiles[$sFilePath] = $aFileInfo;
}
}
}
@@ -98,7 +103,6 @@ class FilesIntegrity
$sChecksum = md5($sContent);
if (($iSize != $aFileInfo['size']) || ($sChecksum != $aFileInfo['md5']))
{
throw new FileIntegrityException(Dict::Format('FilesInformation:Error:CorruptedFile', basename($sFile)));
}
}