trim(shell_exec('git rev-parse HEAD')), 'lastCommitTimestamp' => trim(shell_exec('git log -1 --format=%cd')), 'branch' => trim(shell_exec('git rev-parse --abbrev-ref HEAD')), ]; echo json_encode($git); } 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"]]); }