1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-29 11:00:10 +02:00

refactor: move cache logic into the factory (#2884)

This commit is contained in:
Dag
2022-07-05 13:20:01 +02:00
committed by GitHub
parent 5b9b579652
commit 321ec7c8c1
10 changed files with 16 additions and 15 deletions

View File

@@ -115,7 +115,7 @@ class ElloBridge extends BridgeAbstract
{
$cacheFac = new CacheFactory();
$cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$cache = $cacheFac->create();
$cache->setScope(get_called_class());
$cache->setKey(['key']);
$key = $cache->loadData();

View File

@@ -96,7 +96,7 @@ class InstagramBridge extends BridgeAbstract
$cacheFac = new CacheFactory();
$cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$cache = $cacheFac->create();
$cache->setScope(get_called_class());
$cache->setKey([$username]);
$key = $cache->loadData();

View File

@@ -124,7 +124,7 @@ HTML;
$cacheFac = new CacheFactory();
$this->clientIDCache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$this->clientIDCache = $cacheFac->create();
$this->clientIDCache->setScope(get_called_class());
$this->clientIDCache->setKey(['client_id']);
}

View File

@@ -102,7 +102,7 @@ class SpotifyBridge extends BridgeAbstract
{
$cacheFac = new CacheFactory();
$cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$cache = $cacheFac->create();
$cache->setScope(get_called_class());
$cache->setKey(['token']);

View File

@@ -505,7 +505,7 @@ EOD;
{
$cacheFac = new CacheFactory();
$r_cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$r_cache = $cacheFac->create();
$r_cache->setScope(get_called_class());
$r_cache->setKey(['refresh']);
$data = $r_cache->loadData();
@@ -520,7 +520,7 @@ EOD;
$cacheFac = new CacheFactory();
$cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$cache = $cacheFac->create();
$cache->setScope(get_called_class());
$cache->setKey(['api_key']);
$data = $cache->loadData();
@@ -557,7 +557,7 @@ EOD;
$cacheFac2 = new CacheFactory();
$gt_cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$gt_cache = $cacheFac->create();
$gt_cache->setScope(get_called_class());
$gt_cache->setKey(['guest_token']);
$guestTokenUses = $gt_cache->loadData();