make the cache adapter as config options and use them when calling the cache lib

This commit is contained in:
HB9HIL
2026-02-01 19:33:51 +01:00
parent 549307e5f1
commit 3a2bce8646
9 changed files with 33 additions and 11 deletions

View File

@@ -15,7 +15,7 @@ class Rate_limit {
public function __construct() {
$this->CI =& get_instance();
$this->CI->load->driver('cache', ['adapter' => 'file']);
$this->CI->load->driver('cache', ['adapter' => $this->CI->config->item('cache_adapter'), 'backup' => $this->CI->config->item('cache_backup')]);
// Load rate limit config - if not set or empty, rate limiting is disabled
$this->rate_limits = $this->CI->config->item('api_rate_limits');