mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
some methods were camelCase and some snake_case. made all snake_case as this is usual for our codebase
This commit is contained in:
@@ -40,21 +40,21 @@ class DxclusterCache {
|
||||
/**
|
||||
* Generate WORKED callsign cache key
|
||||
*/
|
||||
public function getWorkedCallKey($logbook_key, $callsign) {
|
||||
public function get_worked_call_key($logbook_key, $callsign) {
|
||||
return "dxcluster_worked_call_{$logbook_key}_{$callsign}";
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate WORKED DXCC cache key
|
||||
*/
|
||||
public function getWorkedDxccKey($logbook_key, $dxcc) {
|
||||
public function get_worked_dxcc_key($logbook_key, $dxcc) {
|
||||
return "dxcluster_worked_dxcc_{$logbook_key}_{$dxcc}";
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate WORKED continent cache key
|
||||
*/
|
||||
public function getWorkedContKey($logbook_key, $cont) {
|
||||
public function get_worked_cont_key($logbook_key, $cont) {
|
||||
return "dxcluster_worked_cont_{$logbook_key}_{$cont}";
|
||||
}
|
||||
|
||||
@@ -73,28 +73,28 @@ class DxclusterCache {
|
||||
if (empty($callsign)) return;
|
||||
|
||||
// Get current user's logbook key
|
||||
$logbook_key = $this->getCurrentUserLogbookKey();
|
||||
$logbook_key = $this->_get_current_user_logbook_key();
|
||||
if (empty($logbook_key)) return;
|
||||
|
||||
// Delete callsign cache
|
||||
$this->_delete_from_cache($this->getWorkedCallKey($logbook_key, $callsign));
|
||||
$this->_delete_from_cache($this->get_worked_call_key($logbook_key, $callsign));
|
||||
|
||||
// Look up DXCC and continent from callsign
|
||||
$dxccobj = new Dxcc(null);
|
||||
$dxcc_info = $dxccobj->dxcc_lookup($callsign, date('Y-m-d'));
|
||||
|
||||
if (!empty($dxcc_info['adif'])) {
|
||||
$this->_delete_from_cache($this->getWorkedDxccKey($logbook_key, $dxcc_info['adif']));
|
||||
$this->_delete_from_cache($this->get_worked_dxcc_key($logbook_key, $dxcc_info['adif']));
|
||||
}
|
||||
if (!empty($dxcc_info['cont'])) {
|
||||
$this->_delete_from_cache($this->getWorkedContKey($logbook_key, $dxcc_info['cont']));
|
||||
$this->_delete_from_cache($this->get_worked_cont_key($logbook_key, $dxcc_info['cont']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current user's logbook key from session
|
||||
*/
|
||||
protected function getCurrentUserLogbookKey() {
|
||||
private function _get_current_user_logbook_key() {
|
||||
$user_id = $this->CI->session->userdata('user_id');
|
||||
$active_logbook = $this->CI->session->userdata('active_station_logbook');
|
||||
|
||||
@@ -114,7 +114,7 @@ class DxclusterCache {
|
||||
// INTERNAL HELPERS
|
||||
// =========================================================================
|
||||
|
||||
protected function _delete_from_cache($cache_key) {
|
||||
private function _delete_from_cache($cache_key) {
|
||||
$this->CI->load->driver('cache', [
|
||||
'adapter' => $this->CI->config->item('cache_adapter') ?? 'file',
|
||||
'backup' => $this->CI->config->item('cache_backup') ?? 'file',
|
||||
|
||||
@@ -2784,7 +2784,7 @@ class Logbook_model extends CI_Model {
|
||||
if (!isset($this->spot_status_cache[$cache_key])) {
|
||||
// Check file cache
|
||||
if ($cache_enabled) {
|
||||
$file_cache_key = $this->dxclustercache->getWorkedCallKey($logbook_ids_key, $callsign);
|
||||
$file_cache_key = $this->dxclustercache->get_worked_call_key($logbook_ids_key, $callsign);
|
||||
$cached_data = $this->cache->get($file_cache_key);
|
||||
if ($cached_data !== false) {
|
||||
// Load from file cache into in-memory cache
|
||||
@@ -2802,7 +2802,7 @@ class Logbook_model extends CI_Model {
|
||||
|
||||
if (!isset($this->spot_status_cache[$cache_key])) {
|
||||
if ($cache_enabled) {
|
||||
$file_cache_key = $this->dxclustercache->getWorkedDxccKey($logbook_ids_key, $dxcc);
|
||||
$file_cache_key = $this->dxclustercache->get_worked_dxcc_key($logbook_ids_key, $dxcc);
|
||||
$cached_data = $this->cache->get($file_cache_key);
|
||||
if ($cached_data !== false) {
|
||||
$this->spot_status_cache[$cache_key] = $cached_data;
|
||||
@@ -2818,7 +2818,7 @@ class Logbook_model extends CI_Model {
|
||||
|
||||
if (!isset($this->spot_status_cache[$cache_key])) {
|
||||
if ($cache_enabled) {
|
||||
$file_cache_key = $this->dxclustercache->getWorkedContKey($logbook_ids_key, $cont);
|
||||
$file_cache_key = $this->dxclustercache->get_worked_cont_key($logbook_ids_key, $cont);
|
||||
$cached_data = $this->cache->get($file_cache_key);
|
||||
if ($cached_data !== false) {
|
||||
$this->spot_status_cache[$cache_key] = $cached_data;
|
||||
@@ -3061,7 +3061,7 @@ class Logbook_model extends CI_Model {
|
||||
|
||||
// Save to file cache for 15 minutes
|
||||
if ($cache_enabled) {
|
||||
$file_cache_key = $this->dxclustercache->getWorkedCallKey($logbook_ids_key, $callsign);
|
||||
$file_cache_key = $this->dxclustercache->get_worked_call_key($logbook_ids_key, $callsign);
|
||||
$this->cache->save($file_cache_key, $data, $cache_ttl);
|
||||
}
|
||||
}
|
||||
@@ -3070,7 +3070,7 @@ class Logbook_model extends CI_Model {
|
||||
$this->spot_status_cache[$cache_key] = $data;
|
||||
|
||||
if ($cache_enabled) {
|
||||
$file_cache_key = $this->dxclustercache->getWorkedDxccKey($logbook_ids_key, $dxcc);
|
||||
$file_cache_key = $this->dxclustercache->get_worked_dxcc_key($logbook_ids_key, $dxcc);
|
||||
$this->cache->save($file_cache_key, $data, $cache_ttl);
|
||||
}
|
||||
}
|
||||
@@ -3079,7 +3079,7 @@ class Logbook_model extends CI_Model {
|
||||
$this->spot_status_cache[$cache_key] = $data;
|
||||
|
||||
if ($cache_enabled) {
|
||||
$file_cache_key = $this->dxclustercache->getWorkedContKey($logbook_ids_key, $cont);
|
||||
$file_cache_key = $this->dxclustercache->get_worked_cont_key($logbook_ids_key, $cont);
|
||||
$this->cache->save($file_cache_key, $data, $cache_ttl);
|
||||
}
|
||||
} // Cache NOT WORKED items (negative results) - store empty arrays
|
||||
@@ -3090,7 +3090,7 @@ class Logbook_model extends CI_Model {
|
||||
$this->spot_status_cache[$cache_key] = []; // Empty = not worked
|
||||
|
||||
if ($cache_enabled) {
|
||||
$file_cache_key = $this->dxclustercache->getWorkedCallKey($logbook_ids_key, $callsign);
|
||||
$file_cache_key = $this->dxclustercache->get_worked_call_key($logbook_ids_key, $callsign);
|
||||
$this->cache->save($file_cache_key, [], $cache_ttl);
|
||||
}
|
||||
}
|
||||
@@ -3101,7 +3101,7 @@ class Logbook_model extends CI_Model {
|
||||
$this->spot_status_cache[$cache_key] = [];
|
||||
|
||||
if ($cache_enabled) {
|
||||
$file_cache_key = $this->dxclustercache->getWorkedDxccKey($logbook_ids_key, $dxcc);
|
||||
$file_cache_key = $this->dxclustercache->get_worked_dxcc_key($logbook_ids_key, $dxcc);
|
||||
$this->cache->save($file_cache_key, [], $cache_ttl);
|
||||
}
|
||||
}
|
||||
@@ -3112,7 +3112,7 @@ class Logbook_model extends CI_Model {
|
||||
$this->spot_status_cache[$cache_key] = [];
|
||||
|
||||
if ($cache_enabled) {
|
||||
$file_cache_key = $this->dxclustercache->getWorkedContKey($logbook_ids_key, $cont);
|
||||
$file_cache_key = $this->dxclustercache->get_worked_cont_key($logbook_ids_key, $cont);
|
||||
$this->cache->save($file_cache_key, [], $cache_ttl);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user