mirror of
https://github.com/Icinga/icingaweb2.git
synced 2026-04-15 22:09:28 -04:00
Replace incubator module with icinga-php-legacy library (#5484)
The `icinga-php-legacy` library is the successor to the standalone `icingaweb2-module-incubator` module. Modules such as director and vspheredb that still declare `incubator` as a dependency should load without a separate incubator installation once `icinga-php-legacy` is present. `Module::getRequiredLibraries` now maps an `incubator` module requirement to an `icinga-php-legacy` library requirement when that library is available, and `getRequiredModules` drops `incubator` from the list so the dependency check does not fail. `Manager::loadModule` skips calling `register()` for the incubator module under the same condition, folding that guard into the existing `ipl`/`reactbundle` exclusion to avoid a double-registration. https://github.com/Icinga/icinga-php-legacy replaces https://github.com/Icinga/icingaweb2-module-incubator.
This commit is contained in:
parent
9774f11c2f
commit
eb378ca0dc
2 changed files with 20 additions and 1 deletions
|
|
@ -229,7 +229,11 @@ class Manager
|
|||
$module = new Module($this->app, $name, $basedir);
|
||||
}
|
||||
|
||||
if ($name !== 'ipl' && $name !== 'reactbundle') {
|
||||
if ($name !== 'ipl'
|
||||
&& $name !== 'reactbundle'
|
||||
// Skip incubator registration if icinga-php-legacy exists.
|
||||
&& ($name !== 'incubator' || ! $this->app->getLibraries()->has('icinga-php-legacy'))
|
||||
) {
|
||||
$module->register();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -689,6 +689,16 @@ class Module
|
|||
$requiredLibraries['icinga-php-thirdparty'] = $requiredModules['reactbundle'];
|
||||
}
|
||||
|
||||
// Register incubator as a library requirement only if icinga-php-legacy is present.
|
||||
// The icinga-php-legacy package is not a core requirement of Icinga Web -
|
||||
// only modules that depend on it install it, e.g., director or vspheredb.
|
||||
if (isset($requiredModules['incubator'])
|
||||
&& ! isset($requiredLibraries['icinga-php-legacy'])
|
||||
&& $this->app->getLibraries()->has('icinga-php-legacy')
|
||||
) {
|
||||
$requiredLibraries['icinga-php-legacy'] = $requiredModules['incubator'];
|
||||
}
|
||||
|
||||
return $requiredLibraries;
|
||||
}
|
||||
|
||||
|
|
@ -723,6 +733,11 @@ class Module
|
|||
// Both modules are deprecated and their successors are now dependencies of web itself
|
||||
unset($requiredModules['ipl'], $requiredModules['reactbundle']);
|
||||
|
||||
// Counterpart to getRequiredLibraries: Skip incubator requirement if icinga-php-legacy exists.
|
||||
if (isset($requiredModules['incubator']) && $this->app->getLibraries()->has('icinga-php-legacy')) {
|
||||
unset($requiredModules['incubator']);
|
||||
}
|
||||
|
||||
return $requiredModules;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue