mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
refactored the cache loader
- adjusted formatting to make it easier to read - added the key prefix from config - made everything failsafe since users don't have that configured by default
This commit is contained in:
@@ -18,7 +18,11 @@ class Sattimers extends CI_Controller {
|
||||
|
||||
$url = 'https://www.df2et.de/tevel/api2.php?grid='.strtoupper($this->stations->find_gridsquare());
|
||||
|
||||
$this->load->driver('cache', ['adapter' => $this->config->item('cache_adapter'), 'backup' => $this->config->item('cache_backup')]);
|
||||
$this->load->driver('cache', [
|
||||
'adapter' => $this->config->item('cache_adapter') ?? 'file',
|
||||
'backup' => $this->config->item('cache_backup') ?? 'file',
|
||||
'key_prefix' => $this->config->item('cache_key_prefix') ?? ''
|
||||
]);
|
||||
if (!$RawData = $this->cache->get('SatTimers'.strtoupper($this->stations->find_gridsquare()))) {
|
||||
$RawData = file_get_contents($url, true);
|
||||
$this->cache->save('SatTimers'.strtoupper($this->stations->find_gridsquare()), $RawData, (60*1));
|
||||
|
||||
Reference in New Issue
Block a user