1 | <?php |
||
13 | class Config { |
||
14 | /** |
||
15 | * Configuration type. |
||
16 | * |
||
17 | * @var ConfigType |
||
18 | */ |
||
19 | public $type; |
||
20 | |||
21 | /** |
||
22 | * App entry file. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | public $file; |
||
27 | |||
28 | /** |
||
29 | * App url. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | public $url; |
||
34 | |||
35 | /** |
||
36 | * App path. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | public $path; |
||
41 | |||
42 | /** |
||
43 | * App slug. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | public $slug; |
||
48 | |||
49 | /** |
||
50 | * App basename. |
||
51 | * |
||
52 | * @var string |
||
53 | */ |
||
54 | public $basename; |
||
55 | |||
56 | /** |
||
57 | * Loaded JSON configuration files. |
||
58 | * |
||
59 | * @var array |
||
60 | */ |
||
61 | private $json = array(); |
||
62 | |||
63 | /** |
||
64 | * Loaded PHP configuration files. |
||
65 | * |
||
66 | * @var array |
||
67 | */ |
||
68 | private $php = array(); |
||
69 | |||
70 | /** |
||
71 | * Config constructor. |
||
72 | * |
||
73 | * @param string $type |
||
74 | * @param string $file |
||
75 | */ |
||
76 | 27 | public function __construct( $type, $file ) { |
|
94 | |||
95 | /** |
||
96 | * Load a JSON file from the resources folder. |
||
97 | * |
||
98 | * @param string $filename |
||
99 | * |
||
100 | * @return array|null |
||
101 | */ |
||
102 | public function get_json_resource( $filename ) { |
||
121 | |||
122 | /** |
||
123 | * Load a configuration PHP file from the config folder. |
||
124 | * |
||
125 | * @param string $filename |
||
126 | * |
||
127 | * @return array|null |
||
128 | */ |
||
129 | public function get_php_config( $filename ) { |
||
142 | } |
||
143 |