Do not use a new function for getting the configuration directory in our web wizard
This commit is contained in:
parent
839523a73f
commit
19387b24ab
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue