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:
@@ -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();
|
||||
|
@@ -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();
|
||||
|
@@ -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']);
|
||||
}
|
||||
|
@@ -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']);
|
||||
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user