mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-20 23:31:37 +02:00
refactor: loadCacheValue/saveCacheValue (#4205)
This commit is contained in:
@@ -164,7 +164,7 @@ class BugzillaBridge extends BridgeAbstract
|
||||
}
|
||||
|
||||
$cache = $this->loadCacheValue($this->instance . $user);
|
||||
if (!is_null($cache)) {
|
||||
if ($cache) {
|
||||
return $cache;
|
||||
}
|
||||
|
||||
|
@@ -676,7 +676,7 @@ class FurAffinityBridge extends BridgeAbstract
|
||||
$name = parent::getName();
|
||||
if ($this->getOption('aCookie') !== null) {
|
||||
$username = $this->loadCacheValue('username');
|
||||
if ($username !== null) {
|
||||
if ($username) {
|
||||
$name = $username . '\'s ' . parent::getName();
|
||||
}
|
||||
}
|
||||
|
@@ -667,7 +667,7 @@ class ItakuBridge extends BridgeAbstract
|
||||
if ($getJSON) { //get JSON object
|
||||
if ($cache) {
|
||||
$data = $this->loadCacheValue($url);
|
||||
if (is_null($data)) {
|
||||
if (!$data) {
|
||||
$data = getContents($url, $httpHeaders, $curlOptions);
|
||||
$this->saveCacheValue($url, $data);
|
||||
}
|
||||
|
@@ -105,7 +105,7 @@ class MastodonBridge extends BridgeAbstract
|
||||
break;
|
||||
}
|
||||
$rtUser = $this->loadCacheValue($rtContent['attributedTo']);
|
||||
if (!isset($rtUser)) {
|
||||
if (!$rtUser) {
|
||||
// We fetch the author, since we cannot always assume the format of the URL.
|
||||
$user = $this->fetchAP($rtContent['attributedTo']);
|
||||
preg_match('/https?:\/\/([a-z0-9-\.]{0,})\//', $rtContent['attributedTo'], $matches);
|
||||
|
@@ -314,7 +314,7 @@ class PixivBridge extends BridgeAbstract
|
||||
{
|
||||
// checks if cookie is set, if not initialise it with the cookie from the config
|
||||
$value = $this->loadCacheValue('cookie');
|
||||
if (!isset($value)) {
|
||||
if (!$value) {
|
||||
$value = $this->getOption('cookie');
|
||||
|
||||
// 30 days + 1 day to let cookie chance to renew
|
||||
|
@@ -118,7 +118,7 @@ The default URI shows the Madara demo page.';
|
||||
{
|
||||
$url_cache = 'TitleInfo_' . preg_replace('/[^\w]/', '.', rtrim($url, '/'));
|
||||
$cache = $this->loadCacheValue($url_cache);
|
||||
if (isset($cache)) {
|
||||
if ($cache) {
|
||||
return $cache;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user