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