2024-06-03 19:48:39 +02:00
|
|
|
<?php
|
2024-06-13 16:03:44 +02:00
|
|
|
|
|
|
|
if($_SERVER["REQUEST_URI"] == '/metrics') {
|
|
|
|
header('Content-Type: text/plain; version=0.0.4');
|
|
|
|
$config = getenv('CONFIG_FILE');
|
|
|
|
$phpbin = getenv('PHP_BINARY');
|
|
|
|
$output = shell_exec('CONFIG_FILE="' . $config . '" ' . $phpbin . ' ' . $_SERVER['DOCUMENT_ROOT'] . 'script.php');
|
|
|
|
echo $output;
|
|
|
|
} else {
|
|
|
|
require_once('vendor/autoload.php');
|
|
|
|
http_response_code(404);
|
|
|
|
$loader = new \Twig\Loader\FilesystemLoader('templates');
|
|
|
|
$twig = new \Twig\Environment($loader, [
|
|
|
|
'cache' => 'twig_cache',
|
|
|
|
]);
|
|
|
|
echo $twig->render('404.twig', ['path' => $_SERVER["REQUEST_URI"]]);
|
|
|
|
}
|