1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-30 03:20:30 +02:00

refactor: CacheFactory (#2834)

This commit is contained in:
Dag
2022-06-22 18:29:28 +02:00
committed by GitHub
parent b7b9378484
commit 07927008eb
10 changed files with 49 additions and 130 deletions

View File

@@ -123,7 +123,7 @@ class ElloBridge extends BridgeAbstract {
private function getAPIKey() {
$cacheFac = new CacheFactory();
$cacheFac->setWorkingDir(PATH_LIB_CACHES);
$cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$cache->setScope(get_called_class());
$cache->setKey(array('key'));

View File

@@ -90,7 +90,7 @@ class InstagramBridge extends BridgeAbstract {
if(is_numeric($username)) return $username;
$cacheFac = new CacheFactory();
$cacheFac->setWorkingDir(PATH_LIB_CACHES);
$cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$cache->setScope(get_called_class());
$cache->setKey(array($username));

View File

@@ -115,7 +115,7 @@ HTML;
return;
$cacheFac = new CacheFactory();
$cacheFac->setWorkingDir(PATH_LIB_CACHES);
$this->clientIDCache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$this->clientIDCache->setScope(get_called_class());
$this->clientIDCache->setKey(array('client_id'));

View File

@@ -88,7 +88,7 @@ class SpotifyBridge extends BridgeAbstract {
private function getToken() {
$cacheFac = new CacheFactory();
$cacheFac->setWorkingDir(PATH_LIB_CACHES);
$cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$cache->setScope(get_called_class());
$cache->setKey(array('token'));

View File

@@ -487,7 +487,7 @@ EOD;
private function getApiKey($forceNew = 0) {
$cacheFac = new CacheFactory();
$cacheFac->setWorkingDir(PATH_LIB_CACHES);
$r_cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$r_cache->setScope(get_called_class());
$r_cache->setKey(array('refresh'));
@@ -502,7 +502,7 @@ EOD;
}
$cacheFac = new CacheFactory();
$cacheFac->setWorkingDir(PATH_LIB_CACHES);
$cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$cache->setScope(get_called_class());
$cache->setKey(array('api_key'));
@@ -539,7 +539,7 @@ EOD;
}
$cacheFac2 = new CacheFactory();
$cacheFac2->setWorkingDir(PATH_LIB_CACHES);
$gt_cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$gt_cache->setScope(get_called_class());
$gt_cache->setKey(array('guest_token'));