-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
43 lines (39 loc) · 1.08 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
<?php
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
header ('Content-type:text/html; charset=utf-8');
require 'vendor/autoload.php';
spl_autoload_register(function ($class_name)
{
// Define an array of directories in the order of their priority to iterate through.
$dirs = array(
'app/',
'app/framework/core/',
'app/framework/databases/',
'app/framework/exceptions/',
'app/framework/services/',
'controller/',
'entity/',
'model/',
'services/'
);
// Looping through each directory to load all the class files. It will only require a file once.
// If it finds the same class in a directory later on, IT WILL IGNORE IT! Because of that require once!
foreach ($dirs as $dir)
{
if (file_exists($dir . $class_name . '.php'))
{
require_once($dir . $class_name . '.php');
return;
}
}
});
try
{
Kernel::getInstance()->response();
}
catch (Exception $e)
{
$e = new TraceableException($e);
Kernel::getInstance()->showException($e);
}