mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
Add setup related utility functions to ApplicationBootstrap.php
This commit is contained in:
parent
7d36a59c67
commit
611d01788f
@ -113,6 +113,13 @@ abstract class ApplicationBootstrap
|
|||||||
*/
|
*/
|
||||||
protected $isWeb = false;
|
protected $isWeb = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether Icinga Web 2 requires setup
|
||||||
|
*
|
||||||
|
* @type bool
|
||||||
|
*/
|
||||||
|
protected $requiresSetup = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -393,6 +400,40 @@ abstract class ApplicationBootstrap
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the setup module if Icinga Web 2 requires setup
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
protected function loadSetupModuleIfNecessary()
|
||||||
|
{
|
||||||
|
if (! @file_exists($this->config->resolvePath('config.ini'))) {
|
||||||
|
$this->requiresSetup = true;
|
||||||
|
$this->moduleManager->loadModule('setup');
|
||||||
|
}
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get whether Icinga Web 2 requires setup
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function requiresSetup()
|
||||||
|
{
|
||||||
|
return $this->requiresSetup;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get whether the setup token exists
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function setupTokenExists()
|
||||||
|
{
|
||||||
|
return @file_exists($this->config->resolvePath('setup.token'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup default logging
|
* Setup default logging
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user