Merge pull request #8142 from nupplaphil/task/di_config

CleanUp Config namespace
This commit is contained in:
Hypolite Petovan 2020-01-19 22:22:57 -05:00 committed by GitHub
commit 04d620fc2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
207 changed files with 1276 additions and 1439 deletions

View file

@ -4,7 +4,6 @@
*/
namespace Friendica\Worker;
use Friendica\Core\Config;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
@ -87,7 +86,7 @@ class OnePoll
}
// Don't poll if polling is deactivated (But we poll feeds and mails anyway)
if (!in_array($protocol, [Protocol::FEED, Protocol::MAIL]) && Config::get('system', 'disable_polling')) {
if (!in_array($protocol, [Protocol::FEED, Protocol::MAIL]) && DI::config()->get('system', 'disable_polling')) {
Logger::log('Polling is disabled');
// set the last-update so we don't keep polling
@ -118,7 +117,7 @@ class OnePoll
$xml = false;
if ($contact['subhub']) {
$poll_interval = Config::get('system', 'pushpoll_frequency', 3);
$poll_interval = DI::config()->get('system', 'pushpoll_frequency', 3);
$contact['priority'] = intval($poll_interval);
$hub_update = false;
@ -447,7 +446,7 @@ class OnePoll
{
Logger::log("Mail: Fetching for ".$contact['addr'], Logger::DEBUG);
$mail_disabled = ((function_exists('imap_open') && !Config::get('system', 'imap_disabled')) ? 0 : 1);
$mail_disabled = ((function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) ? 0 : 1);
if ($mail_disabled) {
// set the last-update so we don't keep polling
self::updateContact($contact, ['last-update' => $updated]);