1 | <?php |
||
8 | class ConfigSettings { |
||
9 | |||
10 | /** @var Setting[] metadata as array of Settings objects */ |
||
11 | protected $settings = array(); |
||
12 | /** @var array problematic keys */ |
||
13 | protected $errors; |
||
14 | /** @var Setting undefined settings */ |
||
15 | protected $undefined = array(); |
||
16 | |||
17 | /** @var array all metadata */ |
||
18 | protected $metadata; |
||
19 | /** @var array all default settings */ |
||
20 | protected $default; |
||
21 | /** @var array all local settings */ |
||
22 | protected $local; |
||
23 | /** @var array all protected settings */ |
||
24 | protected $protected; |
||
25 | |||
26 | /** |
||
27 | * ConfigSettings constructor. |
||
28 | */ |
||
29 | public function __construct() { |
||
39 | |||
40 | /** |
||
41 | * Get all settings |
||
42 | * |
||
43 | * @return Setting[] |
||
44 | */ |
||
45 | public function getSettings() { |
||
48 | |||
49 | /** |
||
50 | * Get all unknown settings |
||
51 | * |
||
52 | * @return Setting |
||
53 | */ |
||
54 | public function getUndefined() { |
||
57 | |||
58 | /** |
||
59 | * Get the settings that had some kind of setup problem |
||
60 | * |
||
61 | * @return array associative error, key is the setting, value the error |
||
62 | */ |
||
63 | public function getErrors() { |
||
66 | |||
67 | /** |
||
68 | * Initalizes the $settings and $undefined properties |
||
69 | */ |
||
70 | protected function initSettings() { |
||
93 | |||
94 | /** |
||
95 | * Instantiates the proper class for the given config key |
||
96 | * |
||
97 | * The class is added to the $settings or $undefined arrays and returned |
||
98 | * |
||
99 | * @param string $key |
||
100 | * @return Setting |
||
101 | */ |
||
102 | protected function instantiateClass($key) { |
||
114 | |||
115 | /** |
||
116 | * Return the class to load |
||
117 | * |
||
118 | * @param string $class the class name as given in the meta file |
||
119 | * @param string $key the settings key |
||
120 | * @return string |
||
121 | */ |
||
122 | protected function determineClassName($class, $key) { |
||
136 | |||
137 | } |
||
138 |