]> git.mxchange.org Git - friendica.git/commitdiff
"CreateShadowentry" and "ProfileUpdate" now moved as well
authorMichael <heluecht@pirati.ca>
Sun, 19 Nov 2017 16:59:37 +0000 (16:59 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 19 Nov 2017 16:59:37 +0000 (16:59 +0000)
include/api.php
include/create_shadowentry.php [deleted file]
include/profile_update.php [deleted file]
mod/item.php
mod/profile_photo.php
mod/profiles.php
mod/settings.php
src/Core/Worker.php
src/Worker/CreateShadowentry.php [new file with mode: 0644]
src/Worker/ProfileUpdate.php [new file with mode: 0644]

index 69569bdc185813f638dfa1d659e2526f80aab7e1..d25aeb8c5e85fea64c36fd500f73c9f89df0cc54 100644 (file)
@@ -3873,7 +3873,7 @@ function api_account_update_profile_image($type)
                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) {
diff --git a/include/create_shadowentry.php b/include/create_shadowentry.php
deleted file mode 100644 (file)
index 29222de..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?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);
-}
diff --git a/include/profile_update.php b/include/profile_update.php
deleted file mode 100644 (file)
index 0c5de01..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-use Friendica\Protocol\Diaspora;
-
-function profile_update_run(&$argv, &$argc) {
-       if ($argc != 2) {
-               return;
-       }
-
-       $uid = intval($argv[1]);
-
-       Diaspora::send_profile($uid);
-}
index 400acfc971a3c5bad9ba6e3efdfe1bcb7a80b442..5f5a96d5e9ab9d724c0728c0c4a8e7058fed34ad 100644 (file)
@@ -1064,7 +1064,7 @@ function item_post(App $a) {
        // 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);
index 3ef0118da0178e373c588f345a292d17ec83946b..e80b9ee84e02a15024be814d3e070a8ad243222c 100644 (file)
@@ -135,7 +135,7 @@ function profile_photo_post(App $a) {
                                        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);
                        }
index 545fb2fc78bb6854a5df91d24e361f9c8f3795c1..5a5a649bcf2269da5e22cdecf2b317c1bf3fc2a0 100644 (file)
@@ -506,7 +506,7 @@ function profiles_post(App $a) {
                                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());
index bc6425171c9707e3ff8514d49e8c521231776546..a3ba2ecb915d031b05d3326b761cd9a6eee935f9 100644 (file)
@@ -651,7 +651,7 @@ function settings_post(App $a) {
                }
        }
 
-       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());
index 276179131bec9ed0857f1b02cb6172c5865e2a7f..88b5bdea8968cbd17666835769c1abaee64d03c9 100644 (file)
@@ -923,7 +923,7 @@ class Worker {
         *
         * 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 ""
         *
diff --git a/src/Worker/CreateShadowentry.php b/src/Worker/CreateShadowentry.php
new file mode 100644 (file)
index 0000000..cc05420
--- /dev/null
@@ -0,0 +1,21 @@
+<?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);
+       }
+}
diff --git a/src/Worker/ProfileUpdate.php b/src/Worker/ProfileUpdate.php
new file mode 100644 (file)
index 0000000..43c7696
--- /dev/null
@@ -0,0 +1,19 @@
+<?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);
+       }
+}