config_read_file(): - Refactor to adapt code from parse_config(), parse_config_bootup(), and write_config(). - Don't exit the PHP script on failure - leave that to the caller. - config_read(): generate config cache if needed. Included inside config_read_file() in CE.
write_config() - Refactor to use the updated config_read_file() function.
encrypted_configxml(): - Support different file paths. - Remove config lock.
parse_config(): - Removed - adapted code into config_read_file().
parse_config_bootup(): - Refactor - use config_read_file() for non-boot specific code.
discover_last_backup(): - Attempt to decrypt when discovering backup files. - Also return the parsed config on success.
restore_backup(): - Avoid redundant config parse - use the returned config from discover_last_backup(). - Return bool to indicate success or failure. - Leave error logs to the responsibility of the caller. - Minor improvements to error handling.
Refactor config file reading and recovery
config_read_file():
- Refactor to adapt code from parse_config(), parse_config_bootup(),
and write_config().
- Don't exit the PHP script on failure - leave that to the caller.
- config_read(): generate config cache if needed. Included inside
config_read_file() in CE.
write_config()
- Refactor to use the updated config_read_file() function.
encrypted_configxml():
- Support different file paths.
- Remove config lock.
parse_config():
- Removed - adapted code into config_read_file().
parse_config_bootup():
- Refactor - use config_read_file() for non-boot specific code.
discover_last_backup():
- Attempt to decrypt when discovering backup files.
- Also return the parsed config on success.
restore_backup():
- Avoid redundant config parse - use the returned config from
discover_last_backup().
- Return bool to indicate success or failure.
- Leave error logs to the responsibility of the caller.
- Minor improvements to error handling.