adlerka.top/index.php

35 lines
1.1 KiB
PHP
Raw Normal View History

2024-02-03 16:46:09 +01:00
<?php
2024-02-03 16:54:04 +01:00
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 = array();
$routerRequest = array();
loadRouterConfig();
$canRender = initRouter();
if ($canRender) {
2024-02-04 10:16:51 +01:00
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
2024-02-03 16:54:04 +01:00
session_set_cookie_params(0, '/', "." . $routerRequest["domain"] . "." . $routerRequest["tld"], true, true);
session_start();
if (!isLoggedIn()) {
setDefaultSessionData();
}
2024-02-04 10:16:51 +01:00
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
2024-02-03 16:54:04 +01:00
if ($routerRequest["type"] == "api") {
2024-02-04 10:16:51 +01:00
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
2024-02-03 16:54:04 +01:00
echo getEndpoint($routerRequest["page_name"]);
2024-02-04 10:16:51 +01:00
} /** @noinspection PhpArrayIsAlwaysEmptyInspection */ elseif ($routerRequest["type"] == "page") {
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
2024-02-03 16:54:04 +01:00
echo getPage($routerRequest["page_name"]);
2024-02-01 09:38:16 +01:00
}
2024-02-03 16:46:09 +01:00
}