2015-07-02 15:28:41 +02:00
|
|
|
<?php
|
|
|
|
|
2017-07-26 11:49:51 +02:00
|
|
|
use Icinga\Application\Modules\Module;
|
2017-10-09 15:23:27 +02:00
|
|
|
use dipl\Loader\CompatLoader;
|
2016-03-23 19:35:09 +01:00
|
|
|
|
2019-09-19 16:32:36 +02:00
|
|
|
if (version_compare(PHP_VERSION, '5.6.0') < 0) {
|
2017-07-26 11:49:51 +02:00
|
|
|
include __DIR__ . '/run-php5.3.php';
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-09-19 16:32:36 +02:00
|
|
|
// TODO: this is going to be removed in v1.8.0
|
2017-06-22 02:03:54 +02:00
|
|
|
require_once __DIR__ . '/library/vendor/ipl/Loader/CompatLoader.php';
|
|
|
|
CompatLoader::delegateLoadingToIcingaWeb($this->app);
|
2019-09-11 21:49:02 +02:00
|
|
|
|
2019-09-19 16:32:36 +02:00
|
|
|
/** @var Module $this */
|
2019-09-11 21:49:02 +02:00
|
|
|
$modules = $this->app->getModuleManager();
|
|
|
|
foreach ($this->getDependencies() as $module => $required) {
|
|
|
|
if ($modules->hasEnabled($module)) {
|
|
|
|
$installed = $modules->getModule($module, false)->getVersion();
|
2019-09-19 16:32:36 +02:00
|
|
|
$installed = ltrim($installed, 'v'); // v0.6.0 VS 0.6.0
|
2019-09-11 21:49:02 +02:00
|
|
|
if (preg_match('/^([<>=]+)\s*v?(\d+\.\d+\.\d+)$/', $required, $match)) {
|
|
|
|
$operator = $match[1];
|
|
|
|
$vRequired = $match[2];
|
2019-09-19 16:32:36 +02:00
|
|
|
if (version_compare($installed, $vRequired, $operator)) {
|
2019-09-11 21:49:02 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-17 15:05:55 +02:00
|
|
|
|
|
|
|
include __DIR__ . '/run-missingdeps.php';
|
|
|
|
return;
|
2019-09-11 21:49:02 +02:00
|
|
|
}
|
2019-09-19 16:32:36 +02:00
|
|
|
|
|
|
|
include __DIR__ . '/register-hooks.php';
|