mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 00:34:03 +02:00
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:
parent
ac503031a7
commit
64d4bb089c
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Module\Monitoring;
|
namespace Icinga\Module\Monitoring;
|
||||||
|
|
||||||
|
use Icinga\Application\Icinga;
|
||||||
use Icinga\Web\Form;
|
use Icinga\Web\Form;
|
||||||
use Icinga\Web\Wizard;
|
use Icinga\Web\Wizard;
|
||||||
use Icinga\Web\Request;
|
use Icinga\Web\Request;
|
||||||
@ -124,7 +125,7 @@ class MonitoringWizard extends Wizard implements SetupWizard
|
|||||||
$pageData = $this->getPageData();
|
$pageData = $this->getPageData();
|
||||||
$setup = new Setup();
|
$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(
|
$setup->addStep(
|
||||||
new BackendStep(array(
|
new BackendStep(array(
|
||||||
@ -159,21 +160,4 @@ class MonitoringWizard extends Wizard implements SetupWizard
|
|||||||
{
|
{
|
||||||
return new Requirements();
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user