]> git.mxchange.org Git - friendica.git/blobdiff - include/Contact.php
Issue-#3873
[friendica.git] / include / Contact.php
index 88f588e2f6e4271b898e5111d34d30763953baab..a7a22671feae31a6834c073b71d867ec56d845a5 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 use Friendica\App;
+use Friendica\Core\PConfig;
 use Friendica\Core\System;
+use Friendica\Core\Worker;
 use Friendica\Network\Probe;
 
 // Included here for completeness, but this is a very dangerous operation.
@@ -26,10 +28,10 @@ function user_remove($uid) {
 
        // The user and related data will be deleted in "cron_expire_and_remove_users" (cronjobs.php)
        q("UPDATE `user` SET `account_removed` = 1, `account_expires_on` = UTC_TIMESTAMP() WHERE `uid` = %d", intval($uid));
-       proc_run(PRIORITY_HIGH, "include/notifier.php", "removeme", $uid);
+       Worker::add(PRIORITY_HIGH, "notifier", "removeme", $uid);
 
        // Send an update to the directory
-       proc_run(PRIORITY_LOW, "include/directory.php", $r['url']);
+       Worker::add(PRIORITY_LOW, "directory", $r['url']);
 
        if($uid == local_user()) {
                unset($_SESSION['authenticated']);
@@ -49,7 +51,7 @@ function contact_remove($id) {
                return;
        }
 
-       $archive = get_pconfig($r[0]['uid'], 'system','archive_removed_contacts');
+       $archive = PConfig::get($r[0]['uid'], 'system','archive_removed_contacts');
        if ($archive) {
                q("update contact set `archive` = 1, `network` = 'none', `writable` = 0 where id = %d",
                        intval($id)
@@ -60,7 +62,7 @@ function contact_remove($id) {
        dba::delete('contact', array('id' => $id));
 
        // Delete the rest in the background
-       proc_run(PRIORITY_LOW, 'include/remove_contact.php', $id);
+       Worker::add(PRIORITY_LOW, 'remove_contact', $id);
 }
 
 
@@ -305,7 +307,7 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) {
 
        if ((($profile["addr"] == "") || ($profile["name"] == "")) && ($profile["gid"] != 0) &&
                in_array($profile["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) {
-               proc_run(PRIORITY_LOW, "include/update_gcontact.php", $profile["gid"]);
+               Worker::add(PRIORITY_LOW, "update_gcontact", $profile["gid"]);
        }
 
        // Show contact details of Diaspora contacts only if connected
@@ -803,7 +805,7 @@ function posts_from_contact_url(App $a, $contact_url) {
 
        $author_id = intval($r[0]["author-id"]);
 
-       $contact = ($r[0]["contact-type"] = ACCOUNT_TYPE_COMMUNITY ? 'owner-id' : 'author-id');
+       $contact = ($r[0]["contact-type"] == ACCOUNT_TYPE_COMMUNITY ? 'owner-id' : 'author-id');
 
        $r = q(item_query()." AND `item`.`".$contact."` = %d AND ".$sql.
                " ORDER BY `item`.`created` DESC LIMIT %d, %d",