]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/Expire.php
Merge pull request #5626 from annando/notices-oh-yeah
[friendica.git] / src / Worker / Expire.php
index d40d72eca10101a2921e636139aef1175566adde..b6096b5849405d11b2f68fec6a81c245157a44ad 100644 (file)
@@ -11,7 +11,6 @@ use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
-use Friendica\Database\DBM;
 use Friendica\Model\Item;
 
 require_once 'include/dba.php';
@@ -30,20 +29,9 @@ class Expire
                        logger('Delete expired items', LOGGER_DEBUG);
                        // physically remove anything that has been deleted for more than two months
                        $condition = ["`deleted` AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY"];
-                       $rows = DBA::select('item', ['id', 'iaid', 'icid', 'psid'],  $condition);
+                       $rows = DBA::select('item', ['id'],  $condition);
                        while ($row = DBA::fetch($rows)) {
                                DBA::delete('item', ['id' => $row['id']]);
-                               if (!empty($row['iaid']) && !DBA::exists('item', ['iaid' => $row['iaid']])) {
-                                       DBA::delete('item-activity', ['id' => $row['iaid']]);
-                               }
-                               if (!empty($row['icid']) && !DBA::exists('item', ['icid' => $row['icid']])) {
-                                       DBA::delete('item-content', ['id' => $row['icid']]);
-                               }
-                               // When the permission set will be used in photo and events as well.
-                               // this query here needs to be extended.
-                               if (!empty($row['psid']) && !DBA::exists('item', ['psid' => $row['psid']])) {
-                                       DBA::delete('permissionset', ['id' => $row['psid']]);
-                               }
                        }
                        DBA::close($rows);
 
@@ -68,7 +56,7 @@ class Expire
                        return;
                } elseif (intval($param) > 0) {
                        $user = DBA::selectFirst('user', ['uid', 'username', 'expire'], ['uid' => $param]);
-                       if (DBM::is_result($user)) {
+                       if (DBA::isResult($user)) {
                                logger('Expire items for user '.$user['uid'].' ('.$user['username'].') - interval: '.$user['expire'], LOGGER_DEBUG);
                                Item::expire($user['uid'], $user['expire']);
                                logger('Expire items for user '.$user['uid'].' ('.$user['username'].') - done ', LOGGER_DEBUG);