From a64e36b111b3bd77f18f6f7af43b783acf2b05a6 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 30 Aug 2016 07:52:48 +0000 Subject: [PATCH] Settings: remove all legacy getSettings calls --- application/clicommands/JobsCommand.php | 2 +- library/Director/IcingaConfig/IcingaConfig.php | 7 ++----- library/Director/Settings.php | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/application/clicommands/JobsCommand.php b/application/clicommands/JobsCommand.php index 39f71503..df8f04ce 100644 --- a/application/clicommands/JobsCommand.php +++ b/application/clicommands/JobsCommand.php @@ -79,6 +79,6 @@ class JobsCommand extends Command protected function hasBeenDisabled() { - return $this->db()->getSetting('disable_all_jobs') === 'y'; + return $this->db()->settings()->disable_all_jobs === 'y'; } } diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php index 4c810fe6..cdc332f4 100644 --- a/library/Director/IcingaConfig/IcingaConfig.php +++ b/library/Director/IcingaConfig/IcingaConfig.php @@ -46,7 +46,7 @@ class IcingaConfig $this->connection = $connection; $this->db = $connection->getDbAdapter(); - $this->configFormat = $this->connection->getSetting('config_format', 'v2'); + $this->configFormat = $this->connection->settings()->config_format; } public function getSize() @@ -497,10 +497,7 @@ apply Service for (title => params in host.vars["%s"]) { protected function getMagicApplyVarName() { - return $this->connection->getSetting( - 'magic_apply_for', - '_director_apply_for' - ); + return $this->connection->settings()->magic_apply_for; } protected function usesMagicApplyFor() diff --git a/library/Director/Settings.php b/library/Director/Settings.php index bb2f2442..69fb7d8b 100644 --- a/library/Director/Settings.php +++ b/library/Director/Settings.php @@ -16,6 +16,7 @@ class Settings 'config_format' => 'v2', 'override_services_varname' => '_override_servicevars', 'override_services_templatename' => 'host var overrides (Director)', + // 'disable_all_jobs' => null, // 'y' // 'experimental_features' => null, // 'allow' // 'master_zone' => null, );