The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
dir_fns.php File Reference

Functions

 find_upstream_directory ($dirmode)
 
 check_upstream_directory ()
 
 get_directory_setting ($observer, $setting)
 
 dir_sort_links ()
 Called by the directory_sort widget. More...
 
 sync_directories ($dirmode)
 Checks the directory mode of this hub. More...
 
 update_directory_entry ($ud)
 Given an update record, probe the channel, grab a zot-info packet and refresh/sync the data. More...
 
 local_dir_update ($uid, $force)
 Push local channel updates to a local directory server. More...
 

Function Documentation

check_upstream_directory ( )

Directories may come and go over time. We will need to check that our directory server is still valid occasionally, and reset to something that is if our directory has gone offline for any reason

Referenced by Zotlabs\Daemon\Cron_daily\run().

dir_sort_links ( )

Called by the directory_sort widget.

Referenced by Zotlabs\Widget\Dirsort\widget().

get_directory_setting (   $observer,
  $setting 
)
local_dir_update (   $uid,
  $force 
)

Push local channel updates to a local directory server.

This is called from include/directory.php if a profile is to be pushed to the directory and the local hub in this case is any kind of directory server.

Parameters
int$uid
boolean$force

Referenced by Zotlabs\Daemon\Directory\run().

sync_directories (   $dirmode)

Checks the directory mode of this hub.

Checks the directory mode of this hub to see if it is some form of directory server. If it is, get the directory realm of this hub. Fetch a list of all other directory servers in this realm and request a directory sync packet. This will contain both directory updates and new ratings. Store these all in the DB. In the case of updates, we will query each of them asynchronously from a poller task. Ratings are stored directly if the rater's signature matches.

Parameters
int$dirmode,;
Fixme:
What to do if we're in a different realm?
Fixme:
Go back and pick up earlier ratings if this is a new directory server. These do not get refreshed.
Todo:
Queue or defer if the xchan is not yet present on our site

Referenced by Zotlabs\Daemon\Cron_daily\run().

update_directory_entry (   $ud)

Given an update record, probe the channel, grab a zot-info packet and refresh/sync the data.

Ignore updating records marked as deleted.

If successful, sets ud_last in the DB to the current datetime for this reddress/webbie.

Parameters
array$udEntry from update table

Referenced by Zotlabs\Daemon\Onedirsync\run().