From c975d0f7990c04ae387eed9b1743436f51e3b2fc Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 21 Dec 2019 20:18:44 +0000 Subject: [PATCH] Added documentation --- src/Worker/FetchPoCo.php | 9 ++++++++- src/Worker/UpdateContact.php | 5 +++++ src/Worker/UpdateGContact.php | 5 +++++ src/Worker/UpdateGContacts.php | 10 ++++++---- src/Worker/UpdateGServer.php | 5 ++++- src/Worker/UpdateGServers.php | 3 +-- src/Worker/UpdateServerDirectories.php | 3 +++ src/Worker/UpdateServerDirectory.php | 4 ++++ src/Worker/UpdateSuggestions.php | 4 +++- 9 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/Worker/FetchPoCo.php b/src/Worker/FetchPoCo.php index 372bd37337..67f2e548bd 100644 --- a/src/Worker/FetchPoCo.php +++ b/src/Worker/FetchPoCo.php @@ -9,7 +9,14 @@ use Friendica\Protocol\PortableContact; 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) { PortableContact::load($cid, $uid, $zcid, $url); diff --git a/src/Worker/UpdateContact.php b/src/Worker/UpdateContact.php index f23c5c0a07..0e5fd14128 100644 --- a/src/Worker/UpdateContact.php +++ b/src/Worker/UpdateContact.php @@ -13,6 +13,11 @@ use Friendica\Database\DBA; class UpdateContact { + /** + * Update contact data via probe + * @param int $contact_id Contact ID + * @param string $command + */ public static function execute($contact_id, $command = '') { $force = ($command == "force"); diff --git a/src/Worker/UpdateGContact.php b/src/Worker/UpdateGContact.php index aacebcb80a..1057d0a270 100644 --- a/src/Worker/UpdateGContact.php +++ b/src/Worker/UpdateGContact.php @@ -12,6 +12,11 @@ use Friendica\Database\DBA; class UpdateGContact { + /** + * Update global contact via probe + * @param string $url Global contact url + * @param string $command + */ public static function execute($url, $command = '') { $force = ($command == "force"); diff --git a/src/Worker/UpdateGContacts.php b/src/Worker/UpdateGContacts.php index 64ffb2a50b..1d9d86bcf6 100644 --- a/src/Worker/UpdateGContacts.php +++ b/src/Worker/UpdateGContacts.php @@ -16,22 +16,24 @@ use Friendica\Util\Strings; class UpdateGContacts { - // Updates gcontact entries + /** + * Updates global contacts + */ public static function execute() { if (!Config::get('system', 'poco_completion')) { return; } - Logger::info('Discover contacts'); + Logger::info('Update global contacts'); $starttime = time(); $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 `last_failure` < UTC_TIMESTAMP - INTERVAL 1 MONTH AND - `network` IN (?, ?, ?, ?, '') ORDER BY rand()", - Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, Protocol::FEED); + `network` IN (?, ?, ?, ?, ?, '') ORDER BY rand()", + Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, Protocol::FEED); $checked = 0; diff --git a/src/Worker/UpdateGServer.php b/src/Worker/UpdateGServer.php index 2e017422fe..b94c5343a0 100644 --- a/src/Worker/UpdateGServer.php +++ b/src/Worker/UpdateGServer.php @@ -10,7 +10,10 @@ use Friendica\Util\Strings; class UpdateGServer { - // Searches for the poco server list. + /** + * Update the given server + * @param string $server_url Server URL + */ public static function execute($server_url) { if (empty($server_url)) { diff --git a/src/Worker/UpdateGServers.php b/src/Worker/UpdateGServers.php index a245c34fca..d55d8df018 100644 --- a/src/Worker/UpdateGServers.php +++ b/src/Worker/UpdateGServers.php @@ -12,8 +12,7 @@ use Friendica\Model\GServer; class UpdateGServers { /** - * @brief Updates the first 250 servers - * + * Updates the first 250 servers */ public static function execute() { diff --git a/src/Worker/UpdateServerDirectories.php b/src/Worker/UpdateServerDirectories.php index e1b12034ad..433685cb29 100644 --- a/src/Worker/UpdateServerDirectories.php +++ b/src/Worker/UpdateServerDirectories.php @@ -11,6 +11,9 @@ use Friendica\Protocol\PortableContact; class UpdateServerDirectories { + /** + * Query global servers for their users + */ public static function execute() { if (Config::get('system', 'poco_discovery') == PortableContact::DISABLED) { diff --git a/src/Worker/UpdateServerDirectory.php b/src/Worker/UpdateServerDirectory.php index 262da2d308..fd5ee0534b 100644 --- a/src/Worker/UpdateServerDirectory.php +++ b/src/Worker/UpdateServerDirectory.php @@ -9,6 +9,10 @@ use Friendica\Model\GServer; class UpdateServerDirectory { + /** + * Query the given server for their users + * @param string $gserver Server URL + */ public static function execute($gserver) { GServer::updateDirectory($gserver); diff --git a/src/Worker/UpdateSuggestions.php b/src/Worker/UpdateSuggestions.php index 222244c1c4..7d45434090 100644 --- a/src/Worker/UpdateSuggestions.php +++ b/src/Worker/UpdateSuggestions.php @@ -9,7 +9,9 @@ use Friendica\Model\GContact; class UpdateSuggestions { - // Discover other servers for their contacts. + /** + * Discover other servers for their contacts. + */ public static function execute() { GContact::updateSuggestions();