Revision 485fe02d
src/etc/inc/config.lib.inc | ||
---|---|---|
1225 | 1225 |
* @return bool True if the configuration was successfully reloaded. |
1226 | 1226 |
*/ |
1227 | 1227 |
function config_read_file(bool $use_backup = false, bool $use_cache = false) { |
1228 |
/* file_notice() is always called at the end to give opportunity for |
|
1229 |
config recovery, otherwise the PHP script may error out too quickly. */ |
|
1228 |
/* We leave calls to file_notice() for the end before returning. |
|
1229 |
* This mitigates the potential for PHP errors to interfere with |
|
1230 |
* the config recovery. */ |
|
1230 | 1231 |
$config_read = function () { |
1231 | 1232 |
$update_cache = false; |
1232 | 1233 |
$parsed_config = @file_get_contents(g_get('tmp_path') . '/config.cache'); |
... | ... | |
1320 | 1321 |
return $config_parsed; |
1321 | 1322 |
} |
1322 | 1323 |
|
1324 |
/** |
|
1325 |
* Reloads the in-memory configuration with config.xml. |
|
1326 |
* |
|
1327 |
* @param bool $parse If False, use the config cache when available. |
|
1328 |
* |
|
1329 |
* @return mixed Config array. |
|
1330 |
* |
|
1331 |
* @deprecated Retained for backwards compatibility with versions <= 24.03. |
|
1332 |
* |
|
1333 |
* @see config_read_file() Supports updated recovery code. |
|
1334 |
*/ |
|
1335 |
function parse_config($parse = false) { |
|
1336 |
config_read_file(!$parse); |
|
1337 |
return config_get_path(''); |
|
1338 |
} |
|
1339 |
|
|
1340 |
/** |
|
1341 |
* Initialize the config path. |
|
1342 |
* |
|
1343 |
* @param array $keys The path as an array of keys. |
|
1344 |
* |
|
1345 |
* @deprecated Retained for backwards compatibility with versions <= 24.03. |
|
1346 |
* |
|
1347 |
* @see config_init_path() Uses a string path. |
|
1348 |
*/ |
|
1349 |
function init_config_arr($keys) { |
|
1350 |
config_init_path(implode('/', $keys)); |
|
1351 |
} |
|
1352 |
|
|
1323 | 1353 |
register_shutdown_function('pfSense_clear_globals'); |
Also available in: Unified diff
Introduce parse_config() and init_config_arr() stubs for backwards compatibility
Clarify comment while there.