-
Notifications
You must be signed in to change notification settings - Fork 4
/
loader.php
53 lines (43 loc) · 1.16 KB
/
loader.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
45
46
47
48
49
50
51
52
53
<?php
spl_autoload_register(function($class){
//print_r(str_replace('\\','/',$class));
/*
* Namespaced Classes
*/
if(file_exists(__DIR__."/".str_replace('\\','/',$class).".php")){
require_once __DIR__."/".str_replace('\\','/',$class).".php";
return 0;
}
/*
* User Classes
*/
if(file_exists(LIBS.$class.".php")){
require_once LIBS.$class.".php";
return 0;
}
if(file_exists(MODELS.$class.".php")){
require_once MODELS.$class.".php";
return 0;
}
if(file_exists(BS.$class.".php")){
require_once BS.$class.".php";
return 0;
}
if(file_exists(MYLIBS.$class.".php")){
require_once MYLIBS.$class.".php";
return 0;
}
if(file_exists(INTERFACES.$class.".php")){
require_once INTERFACES.$class.".php";
return 0;
}
if(file_exists(BRIDGES.$class.".php")){
require_once BRIDGES.$class.".php";
return 0;
}
if(file_exists(FACTORIES.$class.".php")){
require_once FACTORIES.$class.".php";
return 0;
}
//die("$class not found.");
});