(Retrofit from trunk) Preparing for the Hub: better decouple the RunTimeEnvironment from the list of directories to scan/install in order to support installation from the Hub.

SVN:2.4[5274]
This commit is contained in:
Denis Flaven
2018-01-17 10:22:14 +00:00
parent 4ee6e6f915
commit 6e4836f5e0
2 changed files with 52 additions and 3 deletions

View File

@@ -666,6 +666,28 @@ class iTopExtensionsMap
($this->aExtensions[$sModuleIdToFind]->sInstalledVersion !== '') );
}
/**
* Tells if the given module name is "chosen" since it is part of a "chosen" extension (in the specified source dir)
* @param string $sModuleNameToFind
* @param string $sInSourceOnly
* @return boolean
*/
public function ModuleIsChosenAsPartOfAnExtension($sModuleNameToFind, $sInSourceOnly = iTopExtension::SOURCE_REMOTE)
{
$bChosen = false;
foreach($this->GetAllExtensions() as $oExtension)
{
if (($oExtension->sSource == $sInSourceOnly) &&
($oExtension->bMarkedAsChosen == true) &&
(array_key_exists($sModuleNameToFind, $oExtension->aModuleVersion)))
{
return true;
}
}
return false;
}
/**
* Replace a given set of stand-alone modules by one single "extension"
* @param string[] $aModules