mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 17:44: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
|
@ -5,7 +5,6 @@
|
|||
namespace Friendica\Worker;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
|
@ -154,7 +153,7 @@ class CronJobs
|
|||
}
|
||||
|
||||
// clear old cache
|
||||
Cache::clear();
|
||||
DI::cache()->clear();
|
||||
|
||||
// clear old item cache files
|
||||
clear_cache();
|
||||
|
|
|
@ -4,12 +4,13 @@
|
|||
*/
|
||||
namespace Friendica\Worker;
|
||||
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Cache\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Search;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\GContact;
|
||||
use Friendica\Model\GServer;
|
||||
use Friendica\Network\Probe;
|
||||
|
@ -26,7 +27,7 @@ class SearchDirectory
|
|||
return;
|
||||
}
|
||||
|
||||
$data = Cache::get('SearchDirectory:' . $search);
|
||||
$data = DI::cache()->get('SearchDirectory:' . $search);
|
||||
if (!is_null($data)) {
|
||||
// Only search for the same item every 24 hours
|
||||
if (time() < $data + (60 * 60 * 24)) {
|
||||
|
@ -80,6 +81,6 @@ class SearchDirectory
|
|||
}
|
||||
}
|
||||
}
|
||||
Cache::set('SearchDirectory:' . $search, time(), Cache::DAY);
|
||||
DI::cache()->set('SearchDirectory:' . $search, time(), Cache::DAY);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue