]> git.mxchange.org Git - friendica.git/blob - include/remove_contact.php
Remove unrecommended leading backslash for fully qualified namespaces
[friendica.git] / include / remove_contact.php
1 <?php
2 /**
3  * @file include/remove_contact.php
4  * @brief Removes orphaned data from deleted contacts
5  */
6
7 use Friendica\Core\Config;
8
9 function remove_contact_run($argv, $argc) {
10         if ($argc != 2) {
11                 return;
12         }
13
14         $id = intval($argv[1]);
15
16         // Only delete if the contact doesn't exist (anymore)
17         $r = q("SELECT `id` FROM `contact` WHERE `id` = %d", intval($id));
18         if (dbm::is_result($r)) {
19                 return;
20         }
21
22         // Now we delete all the depending table entries
23         dba::delete('contact', array('id' => $id));
24 }