-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.php
More file actions
36 lines (29 loc) · 906 Bytes
/
kernel.php
File metadata and controls
36 lines (29 loc) · 906 Bytes
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
<?php
session_start();
if (version_compare(phpversion(), '5.6.0', '<') == true) {
die ('Your php version is old');
}
require "config.php";
require site_path . "libs/smarty/Smarty.class.php";
function __autoload($class_name) {
$parts = explode("_", $class_name);
$filename = "";
foreach ($parts as $part) {
$filename .= DIRSEP . $part;
}
$filename .= ".php";
$filename = site_path . 'classes' . $filename;
if (file_exists($filename) == false) {
return false;
}
include ($filename);
}
$registry = Registry::getInstance();
$router = new Router($registry);
$registry->set ('router', $router);
$userManager = new UserManager();
$registry->set(Registry::USER_OBJECT, $userManager);
$router->setPath (site_path . 'controllers');
if (cache_enable) $router->delegate_cache();
else $router->delegate();
?>