mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
added github fallback for cty data (dxcc update)
This commit is contained in:
@@ -206,13 +206,27 @@ class Update extends CI_Controller {
|
||||
$this->migration->latest();
|
||||
|
||||
// Download latest file.
|
||||
$url = "https://cdn.clublog.org/cty.php?api=608df94896cb9c5421ae748235492b43815610c9";
|
||||
$url = "https://cdn.clublog.rg/cty.php?api=608df94896cb9c5421ae748235492b43815610c9";
|
||||
|
||||
$gz = gzopen($url, 'r');
|
||||
if ($gz === FALSE) {
|
||||
$this->update_status("FAILED: Could not download from clublog.org");
|
||||
log_message('error', 'FAILED: Could not download data from clublog.org');
|
||||
exit();
|
||||
$msg = "FAILED: Could not download data from clublog.org. Trying alternative URL.";
|
||||
$this->update_status($msg);
|
||||
log_message('error', $msg);
|
||||
|
||||
$alt_url = "https://github.com/wavelog/dxcc_data/raw/refs/heads/master/cty.xml.gz";
|
||||
$gz = gzopen($alt_url, 'r');
|
||||
|
||||
if ($gz === FALSE) {
|
||||
$msg = "FAILED: Could not download dxcc data. Please check your internet connection.";
|
||||
$this->update_status($msg);
|
||||
log_message('error', $msg);
|
||||
exit();
|
||||
} else {
|
||||
$msg = "Downloaded data successfully from alternative URL (github).";
|
||||
$this->update_status($msg);
|
||||
log_message('debug', $msg);
|
||||
}
|
||||
}
|
||||
|
||||
$data = "";
|
||||
|
||||
Reference in New Issue
Block a user