mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-09 00:24:27 +02:00
Merge pull request #8072 from nupplaphil/task/Cache_to_DI
Replace Core\Cache wrapper with DI::cache() method
This commit is contained in:
commit
36190d1e79
21 changed files with 60 additions and 168 deletions
|
@ -10,7 +10,7 @@ use DOMNode;
|
|||
use DOMText;
|
||||
use DOMXPath;
|
||||
use Exception;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Cache\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -66,7 +66,7 @@ class OEmbed
|
|||
if (DBA::isResult($oembed_record)) {
|
||||
$json_string = $oembed_record['content'];
|
||||
} else {
|
||||
$json_string = Cache::get($cache_key);
|
||||
$json_string = DI::cache()->get($cache_key);
|
||||
}
|
||||
|
||||
// These media files should now be caught in bbcode.php
|
||||
|
@ -125,7 +125,7 @@ class OEmbed
|
|||
$cache_ttl = Cache::FIVE_MINUTES;
|
||||
}
|
||||
|
||||
Cache::set($cache_key, $json_string, $cache_ttl);
|
||||
DI::cache()->set($cache_key, $json_string, $cache_ttl);
|
||||
}
|
||||
|
||||
if ($oembed->type == 'error') {
|
||||
|
|
|
@ -10,7 +10,6 @@ use DOMXPath;
|
|||
use Exception;
|
||||
use Friendica\Content\OEmbed;
|
||||
use Friendica\Content\Smilies;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -1070,7 +1069,7 @@ class BBCode
|
|||
private static function removePictureLinksCallback($match)
|
||||
{
|
||||
$cache_key = 'remove:' . $match[1];
|
||||
$text = Cache::get($cache_key);
|
||||
$text = DI::cache()->get($cache_key);
|
||||
|
||||
if (is_null($text)) {
|
||||
$a = DI::app();
|
||||
|
@ -1112,7 +1111,7 @@ class BBCode
|
|||
}
|
||||
}
|
||||
}
|
||||
Cache::set($cache_key, $text);
|
||||
DI::cache()->set($cache_key, $text);
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
@ -1143,7 +1142,7 @@ class BBCode
|
|||
}
|
||||
|
||||
$cache_key = 'clean:' . $match[1];
|
||||
$text = Cache::get($cache_key);
|
||||
$text = DI::cache()->get($cache_key);
|
||||
if (!is_null($text)) {
|
||||
return $text;
|
||||
}
|
||||
|
@ -1194,7 +1193,7 @@ class BBCode
|
|||
}
|
||||
}
|
||||
}
|
||||
Cache::set($cache_key, $text);
|
||||
DI::cache()->set($cache_key, $text);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
namespace Friendica\Content\Widget;
|
||||
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Model\Term;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue