-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
29 lines (26 loc) · 922 Bytes
/
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
<?php
/**
* Created by PhpStorm.
* User: Nicholas
* Date: 7/8/14
* Time: 5:48 PM
*/
mb_internal_encoding("UTF-8");
spl_autoload_extensions( '.php , .class.php' );
function my_autoload($class) {
$classSepIndex = strrpos($class, "\\");
$classPath = str_replace("\\", "/", mb_strtolower(substr($class, 0, $classSepIndex)));
$className = mb_substr($class, $classSepIndex + 1);
if (file_exists(dirname(__FILE__) . "/" . $classPath . "/" . $className . ".class.php")) {
include_once(dirname(__FILE__) . "/" . $classPath . "/" . $className . ".class.php");
} else {
echo 'class ' . $class . ' could not be found in '.dirname(__FILE__) . "/" . $classPath . "/" . $className . ".class.php".".\n";
exit;
}
}
spl_autoload_register("my_autoload");
// redirect to user interface
$query = $_SERVER['PHP_SELF'];
if (\Model\Common\Globals::endsWith($query, "index.php")) {
header('Location: ./interface/step1.php');
}