Worker::add(PRIORITY_LOW, "Directory", $url);
}
- Worker::add(PRIORITY_LOW, 'profile_update', api_user());
+ Worker::add(PRIORITY_LOW, 'ProfileUpdate', api_user());
// output for client
if ($data) {
+++ /dev/null
-<?php
-/**
- * @file include/create_shadowentry.php
- * @brief This script creates posts with UID = 0 for a given public post.
- *
- * This script is started from mod/item.php to save some time when doing a post.
- */
-
-require_once("include/threads.php");
-
-function create_shadowentry_run($argv, $argc) {
- if ($argc != 2) {
- return;
- }
-
- $message_id = intval($argv[1]);
-
- add_shadow_entry($message_id);
-}
+++ /dev/null
-<?php
-use Friendica\Protocol\Diaspora;
-
-function profile_update_run(&$argv, &$argc) {
- if ($argc != 2) {
- return;
- }
-
- $uid = intval($argv[1]);
-
- Diaspora::send_profile($uid);
-}
// We now do it in the background to save some time.
// This is important in interactive environments like the frontend or the API.
// We don't fork a new process since this is done anyway with the following command
- Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "create_shadowentry", $post_id);
+ Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "CreateShadowentry", $post_id);
// Call the background process that is delivering the item to the receivers
Worker::add(PRIORITY_HIGH, "notifier", $notify_type, $post_id);
Worker::add(PRIORITY_LOW, "Directory", $url);
}
- Worker::add(PRIORITY_LOW, 'profile_update', local_user());
+ Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
} else {
notice( t('Unable to process image') . EOL);
}
Worker::add(PRIORITY_LOW, "Directory", $url);
}
- Worker::add(PRIORITY_LOW, 'profile_update', local_user());
+ Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
// Update the global contact for the user
GlobalContact::updateForUser(local_user());
}
}
- Worker::add(PRIORITY_LOW, 'profile_update', local_user());
+ Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
// Update the global contact for the user
GlobalContact::updateForUser(local_user());
*
* next args are passed as $cmd command line
* or: Worker::add(PRIORITY_HIGH, "notifier", "drop", $drop_id);
- * or: Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "create_shadowentry", $post_id);
+ * or: Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "CreateShadowentry", $post_id);
*
* @note $cmd and string args are surrounded with ""
*
--- /dev/null
+<?php
+/**
+ * @file src/Worker/CreateShadowentry.php
+ * @brief This script creates posts with UID = 0 for a given public post.
+ *
+ * This script is started from mod/item.php to save some time when doing a post.
+ */
+
+namespace Friendica\Worker;
+
+require_once("include/threads.php");
+
+class CreateShadowentry {
+ public static function execute($message_id = 0) {
+ if (empty($message_id)) {
+ return;
+ }
+
+ add_shadow_entry($message_id);
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file src/Worker/ProfileUpdate.php
+ * @brief Send updated profile data to Diaspora
+ */
+
+namespace Friendica\Worker;
+
+use Friendica\Protocol\Diaspora;
+
+class ProfileUpdate {
+ public static function execute($uid = 0) {
+ if (empty($uid)) {
+ return;
+ }
+
+ Diaspora::send_profile($uid);
+ }
+}