X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FDirectory.php;h=bb8041a2251e0e919b231ff623d6c9d2afa948cd;hb=38cf0666bd7a6537a5a6af19b5bd6073ef12e82f;hp=ff844ca39209df506abbeb4042f1402f223d51c4;hpb=2ec3a97393959e42d450e074271d2d622d25701f;p=friendica.git diff --git a/src/Worker/Directory.php b/src/Worker/Directory.php index ff844ca392..bb8041a225 100644 --- a/src/Worker/Directory.php +++ b/src/Worker/Directory.php @@ -1,6 +1,6 @@ get('system', 'directory'); + $dir = Search::getGlobalDirectory(); if (!strlen($dir)) { return; @@ -52,25 +53,19 @@ class Directory Hook::callAll('globaldir_update', $arr); - Logger::log('Updating directory: ' . $arr['url'], Logger::DEBUG); + Logger::info('Updating directory: ' . $arr['url']); if (strlen($arr['url'])) { - Network::fetchUrl($dir . '?url=' . bin2hex($arr['url'])); + DI::httpClient()->fetch($dir . '?url=' . bin2hex($arr['url']), HttpClientAccept::HTML); } return; } private static function updateAll() { - $r = q("SELECT `url` FROM `contact` - INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid` - INNER JOIN `user` ON `user`.`uid` = `contact`.`uid` - WHERE `contact`.`self` AND `profile`.`net-publish` AND - NOT `user`.`account_expired` AND `user`.`verified`"); - - if (DBA::isResult($r)) { - foreach ($r AS $user) { - Worker::add(PRIORITY_LOW, 'Directory', $user['url']); - } + $users = DBA::select('owner-view', ['url'], ['net-publish' => true, 'account_expired' => false, 'verified' => true]); + while ($user = DBA::fetch($users)) { + Worker::add(PRIORITY_LOW, 'Directory', $user['url']); } + DBA::close($users); } }