mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
N°4644 - Core update : confusing warning message when integrity of iTop std files is modified - List all modified files
This commit is contained in:
@@ -56,7 +56,7 @@ class FilesInformation
|
||||
|
||||
try
|
||||
{
|
||||
FilesIntegrity::CheckInstallationIntegrity();
|
||||
FilesIntegrity::CheckInstallationIntegrity(APPROOT, false);
|
||||
}
|
||||
catch (FileIntegrityException $e)
|
||||
{
|
||||
|
||||
@@ -81,8 +81,9 @@ class FilesIntegrity
|
||||
* @param string $sRootPath
|
||||
*
|
||||
* @throws \Combodo\iTop\FilesInformation\Service\FileIntegrityException
|
||||
* @since 2.7.7 3.0.1
|
||||
*/
|
||||
public static function CheckInstallationIntegrity($sRootPath = APPROOT)
|
||||
public static function CheckInstallationIntegrity($sRootPath = APPROOT, $bExitAtFirstError = true)
|
||||
{
|
||||
$aFilesInfo = FilesIntegrity::GetInstalledFiles($sRootPath.'manifest.xml');
|
||||
|
||||
@@ -91,6 +92,9 @@ class FilesIntegrity
|
||||
throw new FileIntegrityException(Dict::Format('FilesInformation:Error:MissingFile', 'manifest.xml'));
|
||||
}
|
||||
|
||||
$bHasErrors = false;
|
||||
$sErrorFiles ="";
|
||||
|
||||
@clearstatcache();
|
||||
foreach ($aFilesInfo as $aFileInfo)
|
||||
{
|
||||
@@ -103,11 +107,19 @@ class FilesIntegrity
|
||||
$sChecksum = md5($sContent);
|
||||
if (($iSize != $aFileInfo['size']) || ($sChecksum != $aFileInfo['md5']))
|
||||
{
|
||||
throw new FileIntegrityException(Dict::Format('FilesInformation:Error:CorruptedFile', $sFile));
|
||||
if($bExitAtFirstError) {
|
||||
throw new FileIntegrityException(Dict::Format('FilesInformation:Error:CorruptedFile', $sFile));
|
||||
} else {
|
||||
$bHasErrors = true;
|
||||
$sErrorFiles .='<li> '.$aFileInfo['path'].'</li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
// Packed with missing files...
|
||||
}
|
||||
if($bHasErrors){
|
||||
throw new FileIntegrityException(Dict::Format('FilesInformation:Error:ListCorruptedFile','<ul> '.$sErrorFiles.'</ul>'));
|
||||
}
|
||||
}
|
||||
|
||||
public static function IsInstallationConform($sRootPath, &$sErrorMsg)
|
||||
|
||||
Reference in New Issue
Block a user