mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
More consistent default config dir handling, less configuration
This commit is contained in:
parent
3b20833495
commit
5fdec39475
@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
use Icinga\Application\Cli;
|
use Icinga\Application\Cli;
|
||||||
require_once dirname(__DIR__) . '/library/Icinga/Application/Cli.php';
|
require_once dirname(__DIR__) . '/library/Icinga/Application/Cli.php';
|
||||||
Cli::start('@icingaweb_config_path@')->dispatch();
|
Cli::start()->dispatch();
|
||||||
|
@ -10,12 +10,6 @@ use Icinga\Chart\Inline\PieChart;
|
|||||||
|
|
||||||
error_reporting(E_ALL | E_STRICT);
|
error_reporting(E_ALL | E_STRICT);
|
||||||
|
|
||||||
if (array_key_exists('ICINGAWEB_CONFIGDIR', $_SERVER)) {
|
|
||||||
$configDir = $_SERVER['ICINGAWEB_CONFIGDIR'];
|
|
||||||
} else {
|
|
||||||
$configDir = '/etc/icingaweb';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_SERVER['REQUEST_URI'])) {
|
if (isset($_SERVER['REQUEST_URI'])) {
|
||||||
$ruri = $_SERVER['REQUEST_URI'];
|
$ruri = $_SERVER['REQUEST_URI'];
|
||||||
} else {
|
} else {
|
||||||
@ -59,7 +53,7 @@ $special = array(
|
|||||||
if (in_array($path, $special)) {
|
if (in_array($path, $special)) {
|
||||||
|
|
||||||
include_once __DIR__ . '/EmbeddedWeb.php';
|
include_once __DIR__ . '/EmbeddedWeb.php';
|
||||||
EmbeddedWeb::start($configDir);
|
EmbeddedWeb::start();
|
||||||
|
|
||||||
switch($path) {
|
switch($path) {
|
||||||
|
|
||||||
@ -87,7 +81,7 @@ if (in_array($path, $special)) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
include __DIR__ . '/EmbeddedWeb.php';
|
include __DIR__ . '/EmbeddedWeb.php';
|
||||||
EmbeddedWeb::start($configDir);
|
EmbeddedWeb::start();
|
||||||
header('Content-Type: image/svg+xml');
|
header('Content-Type: image/svg+xml');
|
||||||
$pie = new PieChart();
|
$pie = new PieChart();
|
||||||
$pie->initFromRequest();
|
$pie->initFromRequest();
|
||||||
@ -97,6 +91,6 @@ if (in_array($path, $special)) {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
include __DIR__ . '/Web.php';
|
include __DIR__ . '/Web.php';
|
||||||
Web::start($configDir)->dispatch();
|
Web::start()->dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user