-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
44 lines (34 loc) · 871 Bytes
/
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
<?php
/**
* Auteur : CARDINAL Florian
* Date : 19/03/2020 01:04
* Page : index.php
*/
declare(strict_types = 1);
$sitemap = json_decode(file_get_contents("./core/constants/sitemap.json"), true);
define("HTTPROUTES", $sitemap["views"]);
define("XHRROUTES", $sitemap["actions"]);
require_once('./core/connect.php');
require_once('./core/libs/services.php');
require_once('./core/models/CVModel.php');
if(
!empty($_SERVER['HTTP_X_REQUESTED_WITH'])
&& (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest')
&& (strtolower($_SERVER['REQUEST_METHOD']) === 'post')
) {
/**
* XHR Request Only
*/
session_start();
require_once('./core/controllers/CVController.php');
require_once('./core/XHRRoute.php');
}
else {
/**
* HTTP Request & Other
*/
require_once('./core/HTTPRoute.php');
}
/**
* END
*/