1 | <?php |
||
16 | class Config { |
||
17 | use |
||
18 | Singleton; |
||
19 | const SYSTEM_MODULE = 'System'; |
||
20 | const SYSTEM_THEME = 'CleverStyle'; |
||
21 | /** |
||
22 | * Most of general configuration properties |
||
23 | * |
||
24 | * @var mixed[] |
||
25 | */ |
||
26 | public $core = []; |
||
27 | /** |
||
28 | * Configuration of databases, except the main database, parameters of which are stored in configuration file |
||
29 | * |
||
30 | * @var mixed[] |
||
31 | */ |
||
32 | public $db = []; |
||
33 | /** |
||
34 | * Configuration of storages, except the main storage, parameters of which are stored in configuration file |
||
35 | * |
||
36 | * @var mixed[] |
||
37 | */ |
||
38 | public $storage = []; |
||
39 | /** |
||
40 | * Internal structure of components parameters |
||
41 | * |
||
42 | * @var mixed[] |
||
43 | */ |
||
44 | public $components = []; |
||
45 | /** |
||
46 | * Array of all domains, which allowed to access the site |
||
47 | * |
||
48 | * Contains keys: |
||
49 | * * count - Total count |
||
50 | * * http - Insecure (http) domains |
||
51 | * * https - Secure (https) domains |
||
52 | * |
||
53 | * @var array |
||
54 | */ |
||
55 | public $mirrors = [ |
||
56 | 'count' => 0, |
||
57 | 'http' => [], |
||
58 | 'https' => [] |
||
59 | ]; |
||
60 | /** |
||
61 | * Loading of configuration, initialization of $Config, $Cache, $L and Page objects, Routing processing |
||
62 | * |
||
63 | * @throws ExitException |
||
64 | */ |
||
65 | protected function construct () { |
||
90 | /** |
||
91 | * Is used to fill `$this->mirrors` using current configuration |
||
92 | */ |
||
93 | protected function fill_mirrors () { |
||
101 | /** |
||
102 | * Reloading of settings cache |
||
103 | * |
||
104 | * @return bool |
||
105 | * |
||
106 | * @throws ExitException |
||
107 | */ |
||
108 | protected function load_config_from_db () { |
||
133 | /** |
||
134 | * Applying settings without saving changes into db |
||
135 | * |
||
136 | * @return bool |
||
137 | * |
||
138 | * @throws ExitException |
||
139 | */ |
||
140 | function apply () { |
||
143 | /** |
||
144 | * Applying settings without saving changes into db |
||
145 | * |
||
146 | * @param bool $cache_not_saved_mark |
||
147 | * |
||
148 | * @return bool |
||
149 | * |
||
150 | * @throws ExitException |
||
151 | */ |
||
152 | protected function apply_internal ($cache_not_saved_mark = true) { |
||
177 | /** |
||
178 | * Saving settings |
||
179 | * |
||
180 | * @return bool |
||
181 | * |
||
182 | * @throws ExitException |
||
183 | */ |
||
184 | function save () { |
||
215 | /** |
||
216 | * Whether configuration was applied (not saved) and can be canceled |
||
217 | * |
||
218 | * @return bool |
||
219 | */ |
||
220 | function cancel_available () { |
||
223 | /** |
||
224 | * Canceling of applied settings |
||
225 | * |
||
226 | * @return bool |
||
227 | * |
||
228 | * @throws ExitException |
||
229 | */ |
||
230 | function cancel () { |
||
233 | /** |
||
234 | * Get base url of current mirror including language suffix |
||
235 | * |
||
236 | * @return string |
||
237 | */ |
||
238 | function base_url () { |
||
252 | /** |
||
253 | * Get base url of main domain |
||
254 | * |
||
255 | * @return string |
||
256 | */ |
||
257 | function core_url () { |
||
263 | /** |
||
264 | * Get object for getting db and storage configuration of module |
||
265 | * |
||
266 | * @param string $module_name |
||
267 | * |
||
268 | * @return Config\Module_Properties |
||
269 | */ |
||
270 | function module ($module_name) { |
||
276 | } |
||
277 |