]> git.mxchange.org Git - friendica-addons.git/blobdiff - twitter/twitter_sync.php
Twitter: Offer the disconnect button when the account data is invalid
[friendica-addons.git] / twitter / twitter_sync.php
index 7ff3dbb3781d7042af99fc5714690bf71b244e43..bd4c4444f5c12bc621385b4dd64ec4aab1f231d0 100644 (file)
@@ -1,17 +1,18 @@
 <?php
 
-use Friendica\Core\Config;
+use Friendica\Core\Logger;
+use Friendica\DI;
 
 function twitter_sync_run($argv, $argc)
 {
-       global $a;
+       $a = Friendica\DI::app();
 
        require_once 'addon/twitter/twitter.php';
 
        if (function_exists('sys_getloadavg')) {
                $load = sys_getloadavg();
-               if (intval($load[0]) > Config::get('system', 'maxloadavg', 50)) {
-                       logger('system: load ' . $load[0] . ' too high. Twitter sync deferred to next scheduled run.');
+               if (intval($load[0]) > DI::config()->get('system', 'maxloadavg', 50)) {
+                       Logger::log('system: load ' . $load[0] . ' too high. Twitter sync deferred to next scheduled run.');
                        return;
                }
        }