Merge pull request #8072 from nupplaphil/task/Cache_to_DI

Replace Core\Cache wrapper with DI::cache() method
This commit is contained in:
Hypolite Petovan 2020-01-10 08:46:03 -05:00 committed by GitHub
commit 36190d1e79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 60 additions and 168 deletions

View file

@ -6,7 +6,7 @@
use Friendica\App;
use Friendica\Content\ForumManager;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Cache;
use Friendica\Core\Cache\Cache;
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
@ -197,7 +197,7 @@ function ping_init(App $a)
}
$cachekey = "ping_init:".local_user();
$ev = Cache::get($cachekey);
$ev = DI::cache()->get($cachekey);
if (is_null($ev)) {
$ev = q(
"SELECT type, start, adjust FROM `event`
@ -208,7 +208,7 @@ function ping_init(App $a)
DBA::escape(DateTimeFormat::utcNow())
);
if (DBA::isResult($ev)) {
Cache::set($cachekey, $ev, Cache::HOUR);
DI::cache()->set($cachekey, $ev, Cache::HOUR);
}
}

View file

@ -6,13 +6,12 @@
use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Protocol\PortableContact;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
@ -255,10 +254,10 @@ function poco_init(App $a) {
if (isset($contact['account-type'])) {
$contact['contact-type'] = $contact['account-type'];
}
$about = Cache::get("about:" . $contact['updated'] . ":" . $contact['nurl']);
$about = DI::cache()->get("about:" . $contact['updated'] . ":" . $contact['nurl']);
if (is_null($about)) {
$about = BBCode::convert($contact['about'], false);
Cache::set("about:" . $contact['updated'] . ":" . $contact['nurl'], $about);
DI::cache()->set("about:" . $contact['updated'] . ":" . $contact['nurl'], $about);
}
// Non connected persons can only see the keywords of a Diaspora account