-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
56 lines (43 loc) · 1.5 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
require_once("back/vendor/autoload.php");
/*-----------------------------------
Основные настройки
-----------------------------------*/
require_once "settings.php";
/*-----------------------------------
Основные глобальные классы
-----------------------------------*/
$User = new \classes\User();
$Path = new \classes\helpers\Path();
//$Auth = new \classes\Auth();
/*-----------------------------------
Глобальные выборки
-----------------------------------*/
$globals["auth"] = $User->isAuth($_COOKIE['token']);
$Path->parse();
/*-----------------------------------
Подключаем контроллеры
-----------------------------------*/
if($_GET["url_part_1"] && file_exists(APP_DIR.DS."controllers".DS.$_GET["url_part_1"].".php"))
{
include(APP_DIR.DS."controllers".DS.$_GET["url_part_1"].".php");
}
else{
include(APP_DIR.DS."controllers".DS."index.php");
/*$url_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
switch ($url_path):
case "/": include("App/controllers/main.php"); break;
case "/sitemap.xml":
$_GET['m'] = "sitemap";
include("App/controllers/sitemap.php");
break;
case "/sitemap.image.xml":
$_GET['m'] = "sitemap.image";
include("App/controllers/sitemap.php");
break;
default:
header("HTTP/1.1 404 Not Found");
include('404.html');
exit();
endswitch;*/
}