From a6baa35e05325f936f2d241f81fd143c856ddfb4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 19 Nov 2020 08:56:27 +0100 Subject: [PATCH] Don't depend on ipl as a module anymore --- configuration.php | 10 ---------- .../ProvidedHook/ApplicationState.php | 20 ------------------- module.info | 4 +++- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/configuration.php b/configuration.php index bd55307a..69ebaa76 100644 --- a/configuration.php +++ b/configuration.php @@ -4,20 +4,12 @@ namespace Icinga\Module\Icingadb { - use Icinga\Application\Icinga; - use Icinga\Application\Logger; use Icinga\Authentication\Auth; /** @var \Icinga\Application\Modules\Module $this */ $this->provideSetupWizard('Icinga\Module\Icingadb\Setup\IcingaDbWizard'); - if (! Icinga::app()->getModuleManager()->hasLoaded('ipl')) { - // TODO: Replace this once we have proper dependency management - Logger::warning(t('Module "ipl" is not enabled. This module is mandatory for Icinga DB Web')); - return; - } - if (! $this::exists('monitoring')) { /** * Search urls @@ -225,8 +217,6 @@ namespace Icinga\Module\Icingadb 'url' => 'config/security' ]); - $this->requireCssFile('balls.less', 'ipl'); - $this->provideCssFile('common.less'); $this->provideCssFile('lists.less'); $this->provideCssFile('mixins.less'); diff --git a/library/Icingadb/ProvidedHook/ApplicationState.php b/library/Icingadb/ProvidedHook/ApplicationState.php index cd4c6f7a..7b49014c 100644 --- a/library/Icingadb/ProvidedHook/ApplicationState.php +++ b/library/Icingadb/ProvidedHook/ApplicationState.php @@ -6,7 +6,6 @@ namespace Icinga\Module\Icingadb\ProvidedHook; use Exception; use Icinga\Application\Hook\ApplicationStateHook; -use Icinga\Application\Icinga; use Icinga\Module\Icingadb\Common\Database; use Icinga\Module\Icingadb\Common\IcingaRedis; use Icinga\Module\Icingadb\Model\Instance; @@ -19,25 +18,6 @@ class ApplicationState extends ApplicationStateHook public function collectMessages() { - if (! Icinga::app()->getModuleManager()->hasLoaded('ipl')) { - // TODO: Replace this once we have proper dependency management - $noIplSince = Session::getSession()->getNamespace('icingadb')->get('icingadb.no-ipl-since'); - if ($noIplSince === null) { - $noIplSince = time(); - Session::getSession()->getNamespace('icingadb')->set('icingadb.no-ipl-since', $noIplSince); - } - - $this->addError( - 'icingadb/ipl-missing', - $noIplSince, - t('Module "ipl" is not enabled. This module is mandatory for Icinga DB Web') - ); - - return; - } else { - Session::getSession()->getNamespace('icingadb')->delete('db.no-ipl-since'); - } - $instance = Instance::on($this->getDb())->with(['endpoint'])->first(); if ($instance === null) { diff --git a/module.info b/module.info index 970feb1b..08b65dbe 100644 --- a/module.info +++ b/module.info @@ -1,5 +1,7 @@ Module: icingadb Version: 1.0.0-rc1 -Depends: monitoring (>=2.8.0), ipl (>=0.5.0) +Requires: + Libraries: ipl (>=0.5.0) + Modules: monitoring (>=2.8.0) Description: Icinga DB Web UI for Icinga DB – Provides a graphical interface to your Icinga monitoring