refactor
This commit is contained in:
31
index.php
31
index.php
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
require_once 'secrets/config.php';
|
||||
require_once 'lib/config.php';
|
||||
require_once 'lib/navigation.php';
|
||||
@@ -7,29 +8,19 @@ require_once 'lib/page.php';
|
||||
require_once 'lib/endpoint.php';
|
||||
require_once 'lib/account.php';
|
||||
|
||||
$routerConfig = array();
|
||||
$routerRequest = array();
|
||||
$routerConfig = loadRouterConfig();
|
||||
|
||||
loadRouterConfig();
|
||||
$canRender = initRouter();
|
||||
$routerRequest = initRouter();
|
||||
|
||||
if ($canRender) {
|
||||
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
|
||||
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
|
||||
; session_set_cookie_params(0, '/', "." . $routerRequest["domain"] . "." . $routerRequest["tld"], true, true);
|
||||
session_start();
|
||||
session_start();
|
||||
|
||||
if (!isLoggedIn()) {
|
||||
setDefaultSessionData();
|
||||
}
|
||||
if (!isLoggedIn()) {
|
||||
setDefaultSessionData();
|
||||
}
|
||||
|
||||
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
|
||||
if ($routerRequest["type"] == "api") {
|
||||
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
|
||||
echo getEndpoint($routerRequest["page_name"]);
|
||||
if ($routerRequest["type"] == "api") {
|
||||
echo getEndpoint($routerRequest["page_name"]);
|
||||
|
||||
} /** @noinspection PhpArrayIsAlwaysEmptyInspection */ elseif ($routerRequest["type"] == "page") {
|
||||
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
|
||||
echo getPage($routerRequest["page_name"]);
|
||||
}
|
||||
} elseif ($routerRequest["type"] == "page") {
|
||||
echo getPage($routerRequest["site_name"], $routerRequest["page_name"]);
|
||||
}
|
Reference in New Issue
Block a user