monitoring/setup: Remove function for getting the configuration directory

Getting the config directory is not a task for module wizards.
This commit is contained in:
Eric Lippmann 2015-01-19 11:31:35 +01:00
parent ac503031a7
commit 64d4bb089c
1 changed files with 2 additions and 18 deletions

View File

@ -4,6 +4,7 @@
namespace Icinga\Module\Monitoring;
use Icinga\Application\Icinga;
use Icinga\Web\Form;
use Icinga\Web\Wizard;
use Icinga\Web\Request;
@ -124,7 +125,7 @@ class MonitoringWizard extends Wizard implements SetupWizard
$pageData = $this->getPageData();
$setup = new Setup();
$setup->addStep(new MakeDirStep(array($this->getConfigDir() . '/modules/monitoring'), 2770));
$setup->addStep(new MakeDirStep(array(Icinga::app()->getConfigDir() . '/modules/monitoring'), 2770));
$setup->addStep(
new BackendStep(array(
@ -159,21 +160,4 @@ class MonitoringWizard extends Wizard implements SetupWizard
{
return new 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;
}
}