Cofem/index.php
2024-02-15 10:41:48 +01:00

32 lines
749 B
PHP

<?php
/** @noinspection PhpIncludeInspection */
require_once 'secrets/config.php';
require_once 'lib/config.php';
require_once 'lib/navigation.php';
require_once 'lib/router.php';
require_once 'lib/page.php';
require_once 'lib/endpoint.php';
require_once 'lib/account.php';
$routerConfig = loadRouterConfig();
$routerRequest = initRouter();
session_start();
if (!isLoggedIn()) {
setDefaultSessionData();
}
if($routerRequest["site_name"] == "sitemap.xml") {
require "lib/sitemap.php";
generateSitemap();
exit();
}
if ($routerRequest["type"] == "api") {
echo getEndpoint($routerRequest["site_name"]);
} elseif ($routerRequest["type"] == "page") {
echo getPage($routerRequest["site_name"], $routerRequest["page_name"]);
}