X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fonepoll.php;h=5227b61a1ab118a3066247d631b7b8677776c584;hb=dbbe6efd27cde052402e1d9995f77feb95d1c265;hp=552fea36fa9bd9c7d9d7dc15734e41a77953a63a;hpb=6a165656426a533848554e7b8e0fae2e70f21399;p=friendica.git diff --git a/include/onepoll.php b/include/onepoll.php index 552fea36fa..5227b61a1a 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -2,8 +2,7 @@ use \Friendica\Core\Config; -require_once("boot.php"); -require_once("include/follow.php"); +require_once('include/follow.php'); function RemoveReply($subject) { while (in_array(strtolower(substr($subject, 0, 3)), array("re:", "aw:"))) @@ -13,20 +12,8 @@ function RemoveReply($subject) { } function onepoll_run(&$argv, &$argc){ - global $a, $db; + global $a; - if (is_null($a)) { - $a = new App; - } - - if (is_null($db)) { - @include(".htconfig.php"); - require_once("include/dba.php"); - $db = new dba($db_host, $db_user, $db_pass, $db_data); - unset($db_host, $db_user, $db_pass, $db_data); - }; - - require_once('include/session.php'); require_once('include/datetime.php'); require_once('include/items.php'); require_once('include/Contact.php'); @@ -34,12 +21,6 @@ function onepoll_run(&$argv, &$argc){ require_once('include/socgraph.php'); require_once('include/queue_fn.php'); - Config::load(); - - $a->set_baseurl(get_config('system','url')); - - load_hooks(); - logger('onepoll: start'); $manual_id = 0; @@ -61,13 +42,6 @@ function onepoll_run(&$argv, &$argc){ return; } - // Don't check this stuff if the function is called by the poller - if (App::callstack() != "poller_run") { - if (App::is_already_running('onepoll'.$contact_id, '', 540)) { - return; - } - } - $d = datetime_convert(); // Only poll from those with suitable relationships, @@ -159,7 +133,7 @@ function onepoll_run(&$argv, &$argc){ logger("onepoll: poll: ({$contact['id']}) IMPORTER: {$importer['name']}, CONTACT: {$contact['name']}"); - $last_update = (($contact['last-update'] === '0000-00-00 00:00:00') + $last_update = (($contact['last-update'] <= NULL_DATE) ? datetime_convert('UTC','UTC','now - 7 days', ATOM_TIME) : datetime_convert('UTC','UTC',$contact['last-update'], ATOM_TIME) ); @@ -265,7 +239,7 @@ function onepoll_run(&$argv, &$argc){ intval($contact['id']) ); mark_for_death($contact); - } elseif ($contact['term-date'] != '0000-00-00 00:00:00') { + } elseif ($contact['term-date'] > NULL_DATE) { logger("poller: $url back from the dead - removing mark for death"); unmark_for_death($contact); } @@ -697,8 +671,3 @@ function onepoll_run(&$argv, &$argc){ return; } - -if (array_search(__file__,get_included_files())===0) { - onepoll_run($_SERVER["argv"],$_SERVER["argc"]); - killme(); -}