From 3e02d5aff85babc3ffbfcf52313f2108e313aa23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:46:43 +0200 Subject: Adding upstream version 2.12.1. Signed-off-by: Daniel Baumann --- library/Icinga/Application/webrouter.php | 106 +++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 library/Icinga/Application/webrouter.php (limited to 'library/Icinga/Application/webrouter.php') diff --git a/library/Icinga/Application/webrouter.php b/library/Icinga/Application/webrouter.php new file mode 100644 index 0000000..d9ab30b --- /dev/null +++ b/library/Icinga/Application/webrouter.php @@ -0,0 +1,106 @@ +initFromRequest(); + $pie->toSvg(); +} elseif ($path === 'png/chart.php') { + if (!array_key_exists('data', $_GET)) { + return false; + } + include __DIR__ . '/EmbeddedWeb.php'; + EmbeddedWeb::start(); + header('Content-Type: image/png'); + $pie = new PieChart(); + $pie->initFromRequest(); + $pie->toPng(); +} elseif (substr($path, 0, 4) === 'lib/') { + include_once __DIR__ . '/StaticWeb.php'; + $app = StaticWeb::start(); + (new StaticController())->handle($app->getRequest()); + $app->getResponse()->sendResponse(); +} elseif (file_exists($baseDir . '/' . $path) && is_file($baseDir . '/' . $path)) { + return false; +} else { + include __DIR__ . '/Web.php'; + Web::start()->dispatch(); +} -- cgit v1.2.3