-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
33 lines (28 loc) · 1.2 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
<?php
session_start();
error_reporting(E_ALL);
ini_set('max_execution_time', 0);
define('__SITE_PATH', realpath(dirname(__FILE__)));
$conf_file = __SITE_PATH.DIRECTORY_SEPARATOR.'conf'.DIRECTORY_SEPARATOR.'config.php';
if(file_exists($conf_file)){
include $conf_file;
}else die("<b>Error</b>: <br>Config file not exist");
include __SITE_PATH.DIRECTORY_SEPARATOR.'application'.DIRECTORY_SEPARATOR.'baseController.class.php';
include __SITE_PATH.DIRECTORY_SEPARATOR.'application'.DIRECTORY_SEPARATOR.'registry.class.php';
include __SITE_PATH.DIRECTORY_SEPARATOR.'application'.DIRECTORY_SEPARATOR.'router.class.php';
include __SITE_PATH.DIRECTORY_SEPARATOR.'application'.DIRECTORY_SEPARATOR.'template.class.php';
function __autoload($class_name) {
$filename = $class_name.'.class.php';
$file = __SITE_PATH.DIRECTORY_SEPARATOR.'model'.DIRECTORY_SEPARATOR.$filename;
if(file_exists($file) == false){
return false;
}
include $file;
}
$registry = new registry;
$registry->db = db::getInstance($registry);
$registry->router = new router($registry);
$registry->router->setPath(__SITE_PATH.DIRECTORY_SEPARATOR.'controller');
$registry->template = new template($registry);
$registry->router->loader();
?>