1 | <?php |
||
11 | class App { |
||
12 | |||
13 | /** |
||
14 | * static instance |
||
15 | * |
||
16 | * @var App |
||
17 | */ |
||
18 | public static $cur = null; |
||
19 | |||
20 | /** |
||
21 | * @var App |
||
22 | */ |
||
23 | public static $primary = null; |
||
24 | private $_objects = []; |
||
25 | |||
26 | /** |
||
27 | * App params |
||
28 | */ |
||
29 | public $name = ''; |
||
30 | public $dir = ''; |
||
31 | public $type = 'app'; |
||
32 | public $system = false; |
||
33 | public $default = false; |
||
34 | public $route = ''; |
||
35 | public $installed = false; |
||
36 | public $staticPath = '/static'; |
||
37 | public $templatesPath = '/static/templates'; |
||
38 | public $path = ''; |
||
39 | public $params = []; |
||
40 | public $config = []; |
||
41 | |||
42 | /** |
||
43 | * Constructor App |
||
44 | * |
||
45 | * @param array $preSet |
||
46 | */ |
||
47 | public function __construct($preSet = []) { |
||
52 | |||
53 | /** |
||
54 | * Return module object by name or alias |
||
55 | * |
||
56 | * @param string $className |
||
57 | * @return Module |
||
58 | */ |
||
59 | public function getObject($className, $params = []) { |
||
67 | |||
68 | /** |
||
69 | * Find module class from each paths |
||
70 | * |
||
71 | * @param string $moduleName |
||
72 | * @return mixed |
||
73 | */ |
||
74 | public function findModuleClass($moduleName) { |
||
98 | |||
99 | public function isLoaded($moduleName) { |
||
102 | |||
103 | public function getDomain($decode = false) { |
||
106 | |||
107 | /** |
||
108 | * Load module by name or alias |
||
109 | * |
||
110 | * @param string $className |
||
111 | * @return mixed |
||
112 | */ |
||
113 | public function loadObject($className, $params = []) { |
||
130 | |||
131 | /** |
||
132 | * Reference to module getter |
||
133 | * |
||
134 | * @param string $className |
||
135 | * @return Module|null |
||
136 | */ |
||
137 | public function __get($className) { |
||
140 | |||
141 | /** |
||
142 | * Reference to module getter with params |
||
143 | * |
||
144 | * @param string $className |
||
145 | * @param array $params |
||
146 | * @return Module|null |
||
147 | */ |
||
148 | public function __call($className, $params) { |
||
151 | } |