Added documentation

This commit is contained in:
Michael 2019-12-21 20:18:44 +00:00
parent 537da657cc
commit c975d0f799
9 changed files with 39 additions and 9 deletions

View file

@ -9,7 +9,14 @@ use Friendica\Protocol\PortableContact;
class FetchPoCo class FetchPoCo
{ {
// Load POCO data from a given POCO address /**
* Fetch PortableContacts from a given PoCo server address
*
* @param integer $cid Contact ID
* @param integer $uid User ID
* @param integer $zcid Global Contact ID
* @param integer $url PoCo address that should be polled
*/
public static function execute($cid, $uid, $zcid, $url) public static function execute($cid, $uid, $zcid, $url)
{ {
PortableContact::load($cid, $uid, $zcid, $url); PortableContact::load($cid, $uid, $zcid, $url);

View file

@ -13,6 +13,11 @@ use Friendica\Database\DBA;
class UpdateContact class UpdateContact
{ {
/**
* Update contact data via probe
* @param int $contact_id Contact ID
* @param string $command
*/
public static function execute($contact_id, $command = '') public static function execute($contact_id, $command = '')
{ {
$force = ($command == "force"); $force = ($command == "force");

View file

@ -12,6 +12,11 @@ use Friendica\Database\DBA;
class UpdateGContact class UpdateGContact
{ {
/**
* Update global contact via probe
* @param string $url Global contact url
* @param string $command
*/
public static function execute($url, $command = '') public static function execute($url, $command = '')
{ {
$force = ($command == "force"); $force = ($command == "force");

View file

@ -16,22 +16,24 @@ use Friendica\Util\Strings;
class UpdateGContacts class UpdateGContacts
{ {
// Updates gcontact entries /**
* Updates global contacts
*/
public static function execute() public static function execute()
{ {
if (!Config::get('system', 'poco_completion')) { if (!Config::get('system', 'poco_completion')) {
return; return;
} }
Logger::info('Discover contacts'); Logger::info('Update global contacts');
$starttime = time(); $starttime = time();
$contacts = DBA::p("SELECT `url`, `created`, `updated`, `last_failure`, `last_contact`, `server_url`, `network` FROM `gcontact` $contacts = DBA::p("SELECT `url`, `created`, `updated`, `last_failure`, `last_contact`, `server_url`, `network` FROM `gcontact`
WHERE `last_contact` < UTC_TIMESTAMP - INTERVAL 1 MONTH AND WHERE `last_contact` < UTC_TIMESTAMP - INTERVAL 1 MONTH AND
`last_failure` < UTC_TIMESTAMP - INTERVAL 1 MONTH AND `last_failure` < UTC_TIMESTAMP - INTERVAL 1 MONTH AND
`network` IN (?, ?, ?, ?, '') ORDER BY rand()", `network` IN (?, ?, ?, ?, ?, '') ORDER BY rand()",
Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, Protocol::FEED); Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, Protocol::FEED);
$checked = 0; $checked = 0;

View file

@ -10,7 +10,10 @@ use Friendica\Util\Strings;
class UpdateGServer class UpdateGServer
{ {
// Searches for the poco server list. /**
* Update the given server
* @param string $server_url Server URL
*/
public static function execute($server_url) public static function execute($server_url)
{ {
if (empty($server_url)) { if (empty($server_url)) {

View file

@ -12,8 +12,7 @@ use Friendica\Model\GServer;
class UpdateGServers class UpdateGServers
{ {
/** /**
* @brief Updates the first 250 servers * Updates the first 250 servers
*
*/ */
public static function execute() public static function execute()
{ {

View file

@ -11,6 +11,9 @@ use Friendica\Protocol\PortableContact;
class UpdateServerDirectories class UpdateServerDirectories
{ {
/**
* Query global servers for their users
*/
public static function execute() public static function execute()
{ {
if (Config::get('system', 'poco_discovery') == PortableContact::DISABLED) { if (Config::get('system', 'poco_discovery') == PortableContact::DISABLED) {

View file

@ -9,6 +9,10 @@ use Friendica\Model\GServer;
class UpdateServerDirectory class UpdateServerDirectory
{ {
/**
* Query the given server for their users
* @param string $gserver Server URL
*/
public static function execute($gserver) public static function execute($gserver)
{ {
GServer::updateDirectory($gserver); GServer::updateDirectory($gserver);

View file

@ -9,7 +9,9 @@ use Friendica\Model\GContact;
class UpdateSuggestions class UpdateSuggestions
{ {
// Discover other servers for their contacts. /**
* Discover other servers for their contacts.
*/
public static function execute() public static function execute()
{ {
GContact::updateSuggestions(); GContact::updateSuggestions();