big changes hehe
This commit is contained in:
18
index.php
18
index.php
@@ -1,9 +1,11 @@
|
||||
<?php
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
require_once "secrets/config.php";
|
||||
require_once "lib/navpages.php";
|
||||
require_once "lib/routing.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";
|
||||
|
||||
$routerConfig = array();
|
||||
$routerRequest = array();
|
||||
@@ -13,8 +15,16 @@ if(initRouter()) {
|
||||
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
|
||||
session_set_cookie_params(0, '/', "." . $routerRequest["domain"] . "." . $routerRequest["tld"], true, true);
|
||||
session_start();
|
||||
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
|
||||
echo getPage($routerRequest["page_name"]);
|
||||
if($routerRequest["type"] == "api") {
|
||||
echo getEndpoint($routerRequest["page_name"], $_REQUEST);
|
||||
|
||||
}elseif ($routerRequest["type"] == "page") {
|
||||
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
|
||||
echo getPage($routerRequest["page_name"]);
|
||||
}
|
||||
else{
|
||||
echo "Unknown request";
|
||||
}
|
||||
}
|
||||
else{
|
||||
exit();
|
||||
|
Reference in New Issue
Block a user