-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
44 lines (34 loc) · 1.11 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
<?php
if(!ob_get_level()){
ob_start();
}
$rootPath = str_replace('\\', '/', dirname(__FILE__));
spl_autoload_register(function($class) use($rootPath){
$file = $rootPath .'/'.str_replace('\\', '/', $class).'.php';
if (is_file($file)){
require $file;
}
});
if(is_file('autoload.php')){
require $rootPath.'/autoload.php';
if(isset($autoloaders) && is_array($autoloaders)){
foreach($autoloaders as $loader){
spl_autoload_register($loader);
}
}
}
set_error_handler(function($errno, $errstr, $errfile, $errline){
throw new \ErrorException($errstr, $errno, 0, $errfile, $errline);
});
require $rootPath . '/global.php';
$mvcApplication = new MvcApplication($rootPath);
try {
$mvcApplication->start();
$mvcApplication->init();
$mvcApplication->load();
$mvcApplication->run();
}catch(\Exception $e){
$mvcApplication->error($e);
}
$mvcApplication->end();
?>