3 use Friendica\Core\Config;
4 use Friendica\Core\Worker;
6 function directory_run(&$argv, &$argc){
7 $dir = Config::get('system', 'directory');
14 directory_update_all();
20 $arr = array('url' => $argv[1]);
22 call_hooks('globaldir_update', $arr);
24 logger('Updating directory: ' . $arr['url'], LOGGER_DEBUG);
25 if (strlen($arr['url'])) {
26 fetch_url($dir . '?url=' . bin2hex($arr['url']));
32 function directory_update_all() {
33 $r = q("SELECT `url` FROM `contact`
34 INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid`
35 INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
36 WHERE `contact`.`self` AND `profile`.`net-publish` AND `profile`.`is-default` AND
37 NOT `user`.`account_expired` AND `user`.`verified`");
39 if (dbm::is_result($r)) {
40 foreach ($r AS $user) {
41 Worker::add(PRIORITY_LOW, 'directory', $user['url']);