-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
46 lines (36 loc) · 1.04 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
<?php
include_once 'Configs/config.php';
//if(MIGHTY_MODE == 'dev'){
error_reporting(E_ALL);
ini_set('display_errors','On');
//}
require __DIR__ . '/vendor/autoload.php';
spl_autoload_register(function($class_name) {
$file = MIGHTY . '/' . $class_name . '.php';
if(file_exists($file)) {
require_once $file;
}
});
spl_autoload_register(function($class_name) {
$file = CONTROLLER_PATH . '/' . $class_name . '.php';
if (file_exists($file)) {
require_once $file;
}
});
spl_autoload_register(function($class_name) {
$file = MODEL_PATH . '/' . $class_name . '.php';
if (file_exists($file)) {
require_once $file;
}
});
// Requests from the same server don't have a HTTP_ORIGIN header
if (!array_key_exists('HTTP_ORIGIN', $_SERVER)) {
$_SERVER['HTTP_ORIGIN'] = $_SERVER['SERVER_NAME'];
}
try {
$APP = new \MightyCore\APP($_REQUEST, $_SERVER);
$APP->callAPP();
} catch (Exception $e) {
echo json_encode(Array('error' => $e->getMessage()));
}
?>