]> git.mxchange.org Git - friendica.git/commitdiff
Some more forgotten DBA::close
authorMichael <heluecht@pirati.ca>
Tue, 28 Apr 2020 07:10:18 +0000 (07:10 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 28 Apr 2020 07:10:18 +0000 (07:10 +0000)
14 files changed:
mod/msearch.php
src/Model/Contact.php
src/Model/GContact.php
src/Model/Process.php
src/Model/Search.php
src/Model/UserItem.php
src/Module/Admin/DBSync.php
src/Module/Admin/Site.php
src/Module/Settings/Delegation.php
src/Protocol/ActivityPub/Transmitter.php
src/Protocol/Diaspora.php
src/Worker/CronJobs.php
src/Worker/UpdateGContacts.php
src/Worker/UpdateGServers.php

index b02a036ae4e1996dc4a6853892b77b6b4df71724..14dfd1ef7c1646caf7bfde3bd5f2b269360f196b 100644 (file)
@@ -68,7 +68,7 @@ function msearch_post(App $a)
                $perpage
        );
 
-       while($search_result = DBA::fetch($search_stmt)) {
+       while ($search_result = DBA::fetch($search_stmt)) {
                $results[] = [
                        'name'  => $search_result['name'],
                        'url'   => DI::baseUrl() . '/profile/' . $search_result['nickname'],
@@ -77,6 +77,8 @@ function msearch_post(App $a)
                ];
        }
 
+       DBA::close($search_stmt);
+
        $output = ['total' => $total, 'items_page' => $perpage, 'page' => $page, 'results' => $results];
 
        echo json_encode($output);
index 2435b54f9c75a17afa36ae53b6856cbc1c3b310c..becc80c0c3c6e09e557e77778aaf37cc59882b80 100644 (file)
@@ -2057,6 +2057,7 @@ class Contact
 
                        Worker::add(PRIORITY_HIGH, 'MergeContact', $first, $duplicate['id'], $uid);
                }
+               DBA::close($duplicates);
                Logger::info('Duplicates handled', ['uid' => $uid, 'nurl' => $nurl]);
                return true;
        }
@@ -2732,6 +2733,7 @@ class Contact
                                );
                        }
                }
+               DBA::close($contacts);
        }
 
        /**
index 553976296f997297eb0b91d7f9a6f23e7c47a56a..becfd61b08e44105a9a4452d0b20154a327ad3ff 100644 (file)
@@ -113,6 +113,7 @@ class GContact
 
                        $gcontacts[] = Contact::getDetailsByURL($result['nurl'], local_user());
                }
+               DBA::close($results);
                return $gcontacts;
        }
 
@@ -563,6 +564,7 @@ class GContact
                                PortableContact::loadWorker(0, 0, 0, $base);
                        }
                }
+               DBA::close($contacts);
        }
 
        /**
index 2652929681d6e6209280a74098c9954f9f6f892d..18b5f785a1a619ede1c4609904ff3a83cfbd52dd 100644 (file)
@@ -85,7 +85,7 @@ class Process
                                self::deleteByPid($process['pid']);
                        }
                }
-
+               DBA::close($processes);
                DBA::commit();
        }
 }
index 9e00bbe30874751bd8ae707d136093aef8d18350..ca8960ef35bc6ec2437a0cc078ceffca441a89a6 100644 (file)
@@ -44,7 +44,7 @@ class Search
                while ($term = DBA::fetch($termsStmt)) {
                        $tags[] = trim($term['term'], '#');
                }
-
+               DBA::close($termsStmt);
                return $tags;
        }
 }
index 6a228c098aea8ed420a8d532568ffdcc7a120306..72db1005d10742bdf5c80871e17997d547bf6627 100644 (file)
@@ -214,6 +214,7 @@ class UserItem
                                return true;
                        }
                }
+               DBA::close($tags);
 
                return false;
        }
index 8892c2969165bde30afad0a79102e97753e5f8bc..dd7febcc59123555a1b619a53cfd66164c9416c5 100644 (file)
@@ -102,6 +102,7 @@ class DBSync extends BaseAdmin
                                $failed[] = $upd;
                        }
                }
+               DBA::close($configStmt);
 
                if (!count($failed)) {
                        $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('admin/dbsync/structure_check.tpl'), [
index cf3fee31b1b548a783c053c7f0f30c4df8c2e9c0..f3086856b3af48ae7a085dda0e4f4b57c7982e59 100644 (file)
@@ -121,6 +121,7 @@ class Site extends BaseAdmin
                        while ($user = DBA::fetch($usersStmt)) {
                                Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $user['uid']);
                        }
+                       DBA::close($usersStmt);
 
                        info("Relocation started. Could take a while to complete.");
 
index e70dee8908fab898b96137cb175163a1fc800a0e..e590d6ea773243bd5366634edc373cdeac86d07d 100644 (file)
@@ -125,6 +125,7 @@ class Delegation extends BaseSettings
                while ($contact = DBA::fetch($contacts)) {
                        $nicknames[] = $contact['nick'];
                }
+               DBA::close($contacts);
 
                // get user records for all potential page delegates who are not already delegates or managers
                $potentialDelegateUsers = DBA::selectToArray('user', ['uid', 'username', 'nickname'], ['nickname' => $nicknames]);
index e35d833615abbdea8d31c5b30087d43015684c05..db588ea6d9b14b7e5e254da6d57035bf27fb7617 100644 (file)
@@ -96,6 +96,7 @@ class Transmitter
                        while ($contact = DBA::fetch($contacts)) {
                                $list[] = $contact['url'];
                        }
+                       DBA::close($contacts);
 
                        if (!empty($list)) {
                                $data['next'] = DI::baseUrl() . '/followers/' . $owner['nickname'] . '?page=' . ($page + 1);
@@ -145,6 +146,7 @@ class Transmitter
                        while ($contact = DBA::fetch($contacts)) {
                                $list[] = $contact['url'];
                        }
+                       DBA::close($contacts);
 
                        if (!empty($list)) {
                                $data['next'] = DI::baseUrl() . '/following/' . $owner['nickname'] . '?page=' . ($page + 1);
index fe6c328d9f6da63f76ea147606cced05f4c48ae1..60cb4cf35a9772e35527a96e93cb534f25a927a1 100644 (file)
@@ -124,6 +124,7 @@ class Diaspora
                        while ($server = DBA::fetch($servers)) {
                                $serverlist[$server['url']] = $server['url'];
                        }
+                       DBA::close($servers);
 
                        // All tags of the current post
                        $condition = ['otype' => Term::OBJECT_TYPE_POST, 'type' => Term::HASHTAG, 'oid' => $parent['parent']];
@@ -132,6 +133,7 @@ class Diaspora
                        while ($tag = DBA::fetch($tags)) {
                                $taglist[] = $tag['term'];
                        }
+                       DBA::close($tags);
 
                        // All servers who wants content with this tag
                        $tagserverlist = [];
@@ -140,6 +142,7 @@ class Diaspora
                                while ($server = DBA::fetch($tagserver)) {
                                        $tagserverlist[] = $server['gserver-id'];
                                }
+                               DBA::close($tagserver);
                        }
 
                        // All adresses with the given id
@@ -148,6 +151,7 @@ class Diaspora
                                while ($server = DBA::fetch($servers)) {
                                        $serverlist[$server['url']] = $server['url'];
                                }
+                               DBA::close($servers);
                        }
                }
 
@@ -1720,6 +1724,7 @@ class Diaspora
                while ($contact = DBA::fetch($contacts)) {
                        Contact::remove($contact["id"]);
                }
+               DBA::close($contacts);
 
                DBA::delete('gcontact', ['addr' => $author]);
 
index 2a6c97e84299a53a34bf8c1632cb8744f53fa645..319a369d1fa69a6953059bedb954b81afe8199b2 100644 (file)
@@ -128,6 +128,7 @@ class CronJobs
                while ($user = DBA::fetch($users)) {
                        User::remove($user['uid']);
                }
+               DBA::close($users);
 
                // delete user records for recently removed accounts
                $users = DBA::select('user', ['uid'], ["`account_removed` AND `account_expires_on` < UTC_TIMESTAMP() "]);
@@ -140,6 +141,7 @@ class CronJobs
 
                        DBA::delete('user', ['uid' => $user['uid']]);
                }
+               DBA::close($users);
        }
 
        /**
index 80c0ef524ed5ca6d16968c50dd9a9425d7ae4409..9d9519241b4d738d0a553c87c4313ce122ef5ea8 100644 (file)
@@ -96,5 +96,6 @@ class UpdateGContacts
                                return;
                        }
                }
+               DBA::close($contacts);
        }
 }
index 2200d02e9261419de97d67ac3554c1fff4fdff15..5a45138462f797f9e7c258d6d8a4b81935159f40 100644 (file)
@@ -52,5 +52,6 @@ class UpdateGServers
                                return;
                        }
                }
+               DBA::close($gservers);
        }
 }