1 | <?php |
||
11 | class Loader { |
||
12 | /** @var ConfigParser */ |
||
13 | protected $parser; |
||
14 | |||
15 | /** @var string[] list of enabled plugins */ |
||
16 | protected $plugins; |
||
17 | /** @var string current template */ |
||
18 | protected $template; |
||
19 | |||
20 | /** |
||
21 | * Loader constructor. |
||
22 | * @param ConfigParser $parser |
||
23 | */ |
||
24 | public function __construct(ConfigParser $parser) { |
||
30 | |||
31 | /** |
||
32 | * Read the settings meta data |
||
33 | * |
||
34 | * Reads the main file, plugins and template settings meta data |
||
35 | * |
||
36 | * @return array |
||
37 | */ |
||
38 | public function loadMeta() { |
||
67 | |||
68 | /** |
||
69 | * Read the default values |
||
70 | * |
||
71 | * Reads the main file, plugins and template defaults |
||
72 | * |
||
73 | * @return array |
||
74 | */ |
||
75 | public function loadDefaults() { |
||
104 | |||
105 | /** |
||
106 | * Reads the language strings |
||
107 | * |
||
108 | * Only reads extensions, main one is loaded the usual way |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | public function loadLangs() { |
||
139 | |||
140 | /** |
||
141 | * Read the local settings |
||
142 | * |
||
143 | * @return array |
||
144 | */ |
||
145 | public function loadLocal() { |
||
149 | |||
150 | /** |
||
151 | * Read the protected settings |
||
152 | * |
||
153 | * @return array |
||
154 | */ |
||
155 | public function loadProtected() { |
||
159 | |||
160 | /** |
||
161 | * Read the config values from the given files |
||
162 | * |
||
163 | * @param string[] $files paths to config php's |
||
164 | * @return array |
||
165 | */ |
||
166 | protected function loadConfigs($files) { |
||
173 | |||
174 | /** |
||
175 | * Read settings file from an extension |
||
176 | * |
||
177 | * This is used to read the settings.php files of plugins and templates |
||
178 | * |
||
179 | * @param string $file php file to read |
||
180 | * @param string $type should be 'plugin' or 'tpl' |
||
181 | * @param string $extname name of the extension |
||
182 | * @return array |
||
183 | */ |
||
184 | protected function loadExtensionMeta($file, $type, $extname) { |
||
203 | |||
204 | /** |
||
205 | * Read a default file from an extension |
||
206 | * |
||
207 | * This is used to read the default.php files of plugins and templates |
||
208 | * |
||
209 | * @param string $file php file to read |
||
210 | * @param string $type should be 'plugin' or 'tpl' |
||
211 | * @param string $extname name of the extension |
||
212 | * @return array |
||
213 | */ |
||
214 | protected function loadExtensionConf($file, $type, $extname) { |
||
230 | |||
231 | /** |
||
232 | * Read the language file of an extension |
||
233 | * |
||
234 | * @param string $dir directory of the extension |
||
235 | * @param string $type should be 'plugin' or 'tpl' |
||
236 | * @param string $extname name of the extension |
||
237 | * @return array |
||
238 | */ |
||
239 | protected function loadExtensionLang($dir, $type, $extname) { |
||
264 | } |
||
265 |