mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 07:42:17 +02:00
N°4642 - Core Update : limit the usage of this function to minor version or disable the functionality ?
This commit is contained in:
@@ -13,6 +13,8 @@ use DOMDocument;
|
||||
use DOMElement;
|
||||
use DOMNode;
|
||||
use DOMXPath;
|
||||
use MetaModel;
|
||||
use utils;
|
||||
|
||||
class FilesIntegrity
|
||||
{
|
||||
@@ -82,7 +84,7 @@ class FilesIntegrity
|
||||
*
|
||||
* @throws \Combodo\iTop\FilesInformation\Service\FileIntegrityException
|
||||
*/
|
||||
public static function CheckInstallationIntegrity($sRootPath = APPROOT)
|
||||
public static function CheckInstallationIntegrity($sRootPath = APPROOT, $bCheckNewModule = false)
|
||||
{
|
||||
$aFilesInfo = FilesIntegrity::GetInstalledFiles($sRootPath.'manifest.xml');
|
||||
|
||||
@@ -92,6 +94,7 @@ class FilesIntegrity
|
||||
}
|
||||
|
||||
@clearstatcache();
|
||||
$sSourceDir = MetaModel::GetConfig()->Get('source_dir');
|
||||
foreach ($aFilesInfo as $aFileInfo)
|
||||
{
|
||||
$sFile = $sRootPath.$aFileInfo['path'];
|
||||
@@ -106,6 +109,15 @@ class FilesIntegrity
|
||||
throw new FileIntegrityException(Dict::Format('FilesInformation:Error:CorruptedFile', $sFile));
|
||||
}
|
||||
}
|
||||
if($bCheckNewModule && strpos($aFileInfo['path'],$sSourceDir) === 0){
|
||||
$aFilePath = explode('/',$aFileInfo['path']);
|
||||
$sFolderPath = $aFilePath[0].'/'.$aFilePath[1].'/'.$aFilePath[2];
|
||||
if (is_dir(APPROOT.'/'.$sFolderPath) && !is_file($sRootPath.$sFolderPath)){
|
||||
$sLink = utils::GetAbsoluteUrlAppRoot().'setup/';
|
||||
$sLinkManualUpdate = 'https://www.itophub.io/wiki/page?id='.utils::GetItopVersionWikiSyntax().'%3Ainstall%3Aupgrading_itop#manually';
|
||||
throw new FileIntegrityException(Dict::Format('FilesInformation:Error:CannotUpdateNewModules', $sLink, $sLinkManualUpdate));
|
||||
}
|
||||
}
|
||||
// Packed with missing files...
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user