-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathClassUtil.php
80 lines (63 loc) · 1.88 KB
/
ClassUtil.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
use \app\model\RxCache;
class ClassUtil {
public static $cache = null;
public static $allController;
public static function init($clear=false){
if(self::$cache==null){
self::$cache = new RxCache("annotation",true);
}
if($clear==true){
self::$cache->clear();
}
}
public static function scan(){
self::init(true);
call_user_func(rx_function("rx_scan_classes"));
}
public static function getControllerArray(){
self::$allController = self::$cache->get("Controller#ALL",self::$allController);
return self::$allController;
}
public static function setControllerArray($allController){
self::$allController = $allController;
return self::$cache->set("Controller#ALL",$allController);
}
public static function save(){
self::$cache->save();
}
public static function getMTime($className){
return self::$cache->get("##@@###".$className,0);
}
public static function setMTime($className,$mtime){
return self::$cache->set("##@@###".$className,$mtime);
}
public static function setHandler($name,$info){
return self::$cache->set("Handler#".$name,$info);
}
public static function getHandler($name){
return self::$cache->get("Handler#".$name);
}
public static function setController($name,$info){
return self::$cache->set("Controller#".$name,$info);
}
public static function getController($name){
return self::$cache->get("Controller#".$name);
}
public static function setModel($name,$info){
return self::$cache->set("Model#".$name,$info);
}
public static function getModel($name){
return self::$cache->get("Model#".$name);
}
public static function getSessionUserClass(){
$UserClassInfo = ClassUtil::getModel("sessionUser");
include_once "model/AbstractUser.php";
if($UserClassInfo != NULL){
include_once $UserClassInfo["filePath"];
return $UserClassInfo["className"];
} else {
return "app\\model\\DefaultUser";
}
}
}