From 138f5d2aedebab442faef45466a45619f999f84b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 5 Sep 2016 15:55:26 +0000 Subject: [PATCH] Cli\Command: allow other modules to extend this... ...class --- library/Director/Cli/Command.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Director/Cli/Command.php b/library/Director/Cli/Command.php index 84250a65..0fcf55b5 100644 --- a/library/Director/Cli/Command.php +++ b/library/Director/Cli/Command.php @@ -5,6 +5,7 @@ namespace Icinga\Module\Director\Cli; use Icinga\Cli\Command as CliCommand; use Icinga\Module\Director\Db; use Icinga\Module\Director\Objects\IcingaEndpoint; +use Icinga\Application\Config; class Command extends CliCommand { @@ -74,7 +75,9 @@ class Command extends CliCommand protected function db() { if ($this->db === null) { - $resourceName = $this->Config()->get('db', 'resource'); + // Hint: not using $this->Config() intentionally. This allows + // CLI commands in other modules to use this as a base class. + $resourceName = Config::module('director')->get('db', 'resource'); if ($resourceName) { $this->db = Db::fromResourceName($resourceName); } else {