' . htmlspecialchars($msg, ENT_QUOTES | ENT_HTML5) . ''; } $LIBRARY_INFO = []; function read_global_config() { if (!file_exists(CONFIG_PATH)) { display_error_message('Could not find config file!'); exit(0); } $config_text = file_get_contents(CONFIG_PATH); if ($config_text == null) { display_error_message('Could not read config file!'); exit(0); } $config_json = json_decode($config_text); if ($config_json == null) { display_error_message(json_last_error_msg() . '! Could not decode config file!'); exit(0); } $library_name = $config_json->{'library_name'}; if ($library_name == null) { $library_name = "An Unknown Person's Library"; } $library_albums = $config_json->{'albums'}; if ($library_albums == null) { $library_albums = []; } $photos_license = $config_json->{'license'}; if ($photos_license == null) { $photos_license = "Photos may be copyrighted content"; } else { $photos_license = "Photos are " . $photos_license; } global $LIBRARY_INFO; $LIBRARY_INFO = [ 'name' => $library_name, 'albums' => $library_albums, 'license' => $photos_license ]; } read_global_config(); ?>