]> git.mxchange.org Git - friendica.git/commitdiff
Another worker process moved
authorMichael <heluecht@pirati.ca>
Fri, 17 Nov 2017 22:16:34 +0000 (22:16 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 17 Nov 2017 22:16:34 +0000 (22:16 +0000)
include/Contact.php
include/remove_contact.php [deleted file]
src/Worker/RemoveContact.php [new file with mode: 0644]

index 5d34e452627b2527abd1c68361d2255e6b8587c5..60bef93a5af8e099161ce871275b172f3f434538 100644 (file)
@@ -68,7 +68,7 @@ function contact_remove($id) {
        dba::delete('contact', array('id' => $id));
 
        // Delete the rest in the background
-       Worker::add(PRIORITY_LOW, 'remove_contact', $id);
+       Worker::add(PRIORITY_LOW, 'RemoveContact', $id);
 }
 
 
diff --git a/include/remove_contact.php b/include/remove_contact.php
deleted file mode 100644 (file)
index 9d4b1e4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * @file include/remove_contact.php
- * @brief Removes orphaned data from deleted contacts
- */
-
-use Friendica\Core\Config;
-
-function remove_contact_run($argv, $argc) {
-       if ($argc != 2) {
-               return;
-       }
-
-       $id = intval($argv[1]);
-
-       // Only delete if the contact doesn't exist (anymore)
-       $r = dba::exists('contact', array('id' => $id));
-       if ($r) {
-               return;
-       }
-
-       // Now we delete all the depending table entries
-       dba::delete('contact', array('id' => $id));
-}
diff --git a/src/Worker/RemoveContact.php b/src/Worker/RemoveContact.php
new file mode 100644 (file)
index 0000000..2047de5
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+/**
+ * @file src/Worker/RemoveContact.php
+ * @brief Removes orphaned data from deleted contacts
+ */
+namespace Friendica\Worker;
+
+use Friendica\Core\Config;
+
+class RemoveContact {
+       public static function execute($id) {
+
+               // Only delete if the contact doesn't exist (anymore)
+               $r = dba::exists('contact', array('id' => $id));
+               if ($r) {
+                       return;
+               }
+
+               // Now we delete all the depending table entries
+               dba::delete('contact', array('id' => $id));
+       }
+}