]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/Expire.php
Merge pull request #4243 from MrPetovan/task/switch-to-array-new-style
[friendica.git] / src / Worker / Expire.php
index e963d6d3519d43ae6e278ae26de6b0793ac3fe7c..039ae44db20c9afc335a4c74f8cc2cda5181c741 100644 (file)
@@ -27,7 +27,7 @@ class Expire {
                        // physically remove anything that has been deleted for more than two months
                        $r = dba::p("SELECT `id` FROM `item` WHERE `deleted` AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY");
                        while ($row = dba::fetch($r)) {
-                               dba::delete('item', array('id' => $row['id']));
+                               dba::delete('item', ['id' => $row['id']]);
                        }
                        dba::close($r);
 
@@ -39,7 +39,7 @@ class Expire {
                        }
                        return;
                } elseif (intval($param) > 0) {
-                       $user = dba::select('user', array('uid', 'username', 'expire'), array('uid' => $param), array('limit' => 1));
+                       $user = dba::selectFirst('user', ['uid', 'username', 'expire'], ['uid' => $param]);
                        if (DBM::is_result($user)) {
                                logger('Expire items for user '.$user['uid'].' ('.$user['username'].') - interval: '.$user['expire'], LOGGER_DEBUG);
                                item_expire($user['uid'], $user['expire']);
@@ -58,13 +58,13 @@ class Expire {
 
                logger('expire: start');
 
-               Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
+               Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
                                'Expire', 'delete');
 
                $r = dba::p("SELECT `uid`, `username` FROM `user` WHERE `expire` != 0");
                while ($row = dba::fetch($r)) {
                        logger('Calling expiry for user '.$row['uid'].' ('.$row['username'].')', LOGGER_DEBUG);
-                       Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
+                       Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
                                        'Expire', (int)$row['uid']);
                }
                dba::close($r);
@@ -74,7 +74,7 @@ class Expire {
                if (is_array($a->hooks) && array_key_exists('expire', $a->hooks)) {
                        foreach ($a->hooks['expire'] as $hook) {
                                logger("Calling expire hook for '" . $hook[1] . "'", LOGGER_DEBUG);
-                               Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
+                               Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
                                                'Expire', 'hook', $hook[1]);
                        }
                }