1 | <?php |
||
19 | class EE_Dependency_Map { |
||
20 | |||
21 | |||
22 | /** |
||
23 | * @type EE_Dependency_Map $_instance |
||
24 | */ |
||
25 | protected static $_instance = null; |
||
26 | |||
27 | /** |
||
28 | * @type array $_dependency_map |
||
29 | */ |
||
30 | protected static $_dependency_map = array(); |
||
31 | |||
32 | /** |
||
33 | * @type array $_class_loaders |
||
34 | */ |
||
35 | protected static $_class_loaders = array(); |
||
36 | |||
37 | |||
38 | |||
39 | /** |
||
40 | * EE_Dependency_Map constructor. |
||
41 | */ |
||
42 | protected function __construct() { |
||
47 | |||
48 | |||
49 | |||
50 | /** |
||
51 | * @singleton method used to instantiate class object |
||
52 | * @access public |
||
53 | * @return \EE_Dependency_Map instance |
||
54 | */ |
||
55 | public static function instance() { |
||
62 | |||
63 | |||
64 | |||
65 | /** |
||
66 | * @return array |
||
67 | */ |
||
68 | public static function dependency_map() { |
||
71 | |||
72 | |||
73 | |||
74 | /** |
||
75 | * @param string $class |
||
76 | * @param array $dependencies |
||
77 | * @return boolean |
||
78 | */ |
||
79 | public static function register_dependencies( $class, $dependencies ) { |
||
86 | |||
87 | |||
88 | |||
89 | /** |
||
90 | * @param string $class_name |
||
91 | * @return array |
||
92 | */ |
||
93 | public static function class_loader( $class_name ) { |
||
96 | |||
97 | |||
98 | |||
99 | /** |
||
100 | * @param string $class_name |
||
101 | * @param string $loader |
||
102 | * @return bool |
||
103 | * @throws \EE_Error |
||
104 | */ |
||
105 | public static function register_class_loader( $class_name, $loader = 'load_core' ) { |
||
121 | |||
122 | |||
123 | |||
124 | /** |
||
125 | * Registers the core dependencies |
||
126 | */ |
||
127 | protected function _register_core_dependencies() { |
||
163 | |||
164 | |||
165 | |||
166 | /** |
||
167 | * Registers the core class loaders. |
||
168 | */ |
||
169 | protected function _register_core_class_loaders() { |
||
186 | |||
187 | |||
188 | /** |
||
189 | * This is used to reset the internal map and class_loaders to their original default state at the beginning of the request |
||
190 | * Primarily used by unit tests. |
||
191 | */ |
||
192 | public function reset() { |
||
196 | |||
197 | |||
198 | } |
||
199 | // End of file EE_Dependency_Map.core.php |
||
200 | // Location: /EE_Dependency_Map.core.php |