From 19387b24ab726529d3a7fb7cd25b7bfc83c44f55 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 29 Dec 2014 14:32:20 +0100 Subject: [PATCH] Do not use a new function for getting the configuration directory in our web wizard --- modules/setup/library/Setup/WebWizard.php | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/modules/setup/library/Setup/WebWizard.php b/modules/setup/library/Setup/WebWizard.php index faa123fe8..8dff112f5 100644 --- a/modules/setup/library/Setup/WebWizard.php +++ b/modules/setup/library/Setup/WebWizard.php @@ -9,6 +9,7 @@ use Icinga\Web\Form; use Icinga\Web\Wizard; use Icinga\Web\Request; use Icinga\Application\Config; +use Icinga\Application\Icinga; use Icinga\Application\Platform; use Icinga\Module\Setup\Forms\ModulePage; use Icinga\Module\Setup\Forms\WelcomePage; @@ -343,7 +344,7 @@ class WebWizard extends Wizard implements SetupWizard ); } - $configDir = $this->getConfigDir(); + $configDir = Icinga::app()->getConfigDir(); $setup->addStep( new MakeDirStep( array( @@ -528,7 +529,7 @@ class WebWizard extends Wizard implements SetupWizard ) ); - $configDir = $this->getConfigDir(); + $configDir = Icinga::app()->getConfigDir(); $requirements->addMandatory( mt('setup', 'Writable Config Directory'), mt( @@ -551,21 +552,4 @@ class WebWizard extends Wizard implements SetupWizard return $requirements; } - - /** - * Return the configuration directory of Icinga Web 2 - * - * @return string - */ - protected function getConfigDir() - { - if (array_key_exists('ICINGAWEB_CONFIGDIR', $_SERVER)) { - $configDir = $_SERVER['ICINGAWEB_CONFIGDIR']; - } else { - $configDir = '/etc/icingaweb'; - } - - $canonical = realpath($configDir); - return $canonical ? $canonical : $configDir; - } }