mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 22:34:24 +02:00
Manager: Add method hasUnmetDependencies($name)
This commit is contained in:
parent
baaf663db3
commit
aba8c4a8ba
@ -531,6 +531,36 @@ class Manager
|
|||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given module has unmet dependencies
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasUnmetDependencies($name)
|
||||||
|
{
|
||||||
|
$module = $this->getModule($name, false);
|
||||||
|
|
||||||
|
$requiredMods = $module->getRequiredModules();
|
||||||
|
foreach ($requiredMods as $moduleName => $moduleVersion) {
|
||||||
|
if (! $this->has($moduleName, $moduleVersion)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$libraries = Icinga::app()->getLibraries();
|
||||||
|
|
||||||
|
$requiredLibs = $module->getRequiredLibraries();
|
||||||
|
foreach ($requiredLibs as $libraryName => $libraryVersion) {
|
||||||
|
if (! $libraries->has($libraryName, $libraryVersion)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an array containing all enabled module names as strings
|
* Return an array containing all enabled module names as strings
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user