Skip to content

Commit b6494de

Browse files
committed
fix: replace closeCursor() with free() + schema asset filter
1 parent 2f96229 commit b6494de

File tree

67 files changed

+191
-194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+191
-194
lines changed

apps/dav/lib/CalDAV/CalDavBackend.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function getCalendarsForUser($principalUri) {
209209
}
210210
}
211211

212-
$stmt->closeCursor();
212+
$stmt->free();
213213

214214
// query for shared calendars
215215
$principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
@@ -261,7 +261,7 @@ public function getCalendarsForUser($principalUri) {
261261
$calendars[$calendar['id']] = $calendar;
262262
}
263263
}
264-
$result->closeCursor();
264+
$result->free();
265265

266266
return \array_values($calendars);
267267
}
@@ -309,7 +309,7 @@ public function getUsersOwnCalendars($principalUri) {
309309
}
310310
}
311311

312-
$stmt->closeCursor();
312+
$stmt->free();
313313

314314
return \array_values($calendars);
315315
}
@@ -364,7 +364,7 @@ public function getPublicCalendars() {
364364
$calendars[$calendar['id']] = $calendar;
365365
}
366366
}
367-
$result->closeCursor();
367+
$result->free();
368368

369369
return \array_values($calendars);
370370
}
@@ -395,7 +395,7 @@ public function getPublicCalendar($uri) {
395395

396396
$row = $result->fetch(\PDO::FETCH_ASSOC);
397397

398-
$result->closeCursor();
398+
$result->free();
399399

400400
if ($row === false) {
401401
throw new NotFound('Node with name \'' . $uri . '\' could not be found');
@@ -450,7 +450,7 @@ public function getCalendarByUri($principal, $uri) {
450450
$stmt = $query->execute();
451451

452452
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
453-
$stmt->closeCursor();
453+
$stmt->free();
454454
if ($row === false) {
455455
return null;
456456
}
@@ -494,7 +494,7 @@ public function getCalendarById($calendarId) {
494494
$stmt = $query->execute();
495495

496496
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
497-
$stmt->closeCursor();
497+
$stmt->free();
498498
if ($row === false) {
499499
return null;
500500
}
@@ -784,7 +784,7 @@ public function getMultipleCalendarObjects($calendarId, array $uris) {
784784
'classification' => (int)$row['classification']
785785
];
786786
}
787-
$stmt->closeCursor();
787+
$stmt->free();
788788
return $result;
789789
}
790790
$chunks = \array_chunk($uris, $chunkSize);
@@ -1645,7 +1645,7 @@ public function getPublishStatus($calendar) {
16451645
->execute();
16461646

16471647
$row = $result->fetch();
1648-
$result->closeCursor();
1648+
$result->free();
16491649
return $row ? \reset($row) : false;
16501650
}
16511651

apps/dav/lib/CardDAV/CardDavBackend.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function getUsersOwnAddressBooks($principalUri) {
134134
'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ?: '0',
135135
];
136136
}
137-
$result->closeCursor();
137+
$result->free();
138138
return \array_values($addressBooks);
139139
}
140140

@@ -198,7 +198,7 @@ public function getAddressBooksForUser($principalUri) {
198198
];
199199
}
200200
}
201-
$result->closeCursor();
201+
$result->free();
202202

203203
return \array_values($addressBooks);
204204
}
@@ -214,7 +214,7 @@ public function getAddressBookById($addressBookId) {
214214
->execute();
215215

216216
$row = $result->fetch();
217-
$result->closeCursor();
217+
$result->free();
218218
if ($row === false) {
219219
return null;
220220
}
@@ -244,7 +244,7 @@ public function getAddressBooksByUri($principal, $addressBookUri) {
244244
->execute();
245245

246246
$row = $result->fetch();
247-
$result->closeCursor();
247+
$result->free();
248248
if ($row === false) {
249249
return null;
250250
}
@@ -425,7 +425,7 @@ public function getCards($addressBookId) {
425425
$row['carddata'] = $this->readBlob($row['carddata']);
426426
$cards[] = $row;
427427
}
428-
$result->closeCursor();
428+
$result->free();
429429

430430
return $cards;
431431
}
@@ -491,7 +491,7 @@ public function getMultipleCards($addressBookId, array $uris) {
491491
$row['carddata'] = $this->readBlob($row['carddata']);
492492
$cards[] = $row;
493493
}
494-
$result->closeCursor();
494+
$result->free();
495495

496496
return $cards;
497497
}
@@ -880,7 +880,7 @@ public function searchEx($addressBookId, $pattern, $searchProperties, $options,
880880
$result = $query->execute();
881881
$cards = $result->fetchAll();
882882

883-
$result->closeCursor();
883+
$result->free();
884884

885885
return \array_map(function ($array) {
886886
$array['carddata'] = $this->readBlob($array['carddata']);
@@ -902,7 +902,7 @@ public function collectCardProperties($bookId, $name) {
902902
->execute();
903903

904904
$all = $result->fetchAll(PDO::FETCH_COLUMN);
905-
$result->closeCursor();
905+
$result->free();
906906

907907
return $all;
908908
}
@@ -922,7 +922,7 @@ public function getCardUri($id) {
922922

923923
$result = $query->execute();
924924
$uri = $result->fetch();
925-
$result->closeCursor();
925+
$result->free();
926926

927927
if (!isset($uri['uri'])) {
928928
throw new \InvalidArgumentException('Card does not exist: ' . $id);
@@ -946,7 +946,7 @@ public function getContact($addressBookId, $uri) {
946946
->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
947947
$queryResult = $query->execute();
948948
$contact = $queryResult->fetch();
949-
$queryResult->closeCursor();
949+
$queryResult->free();
950950

951951
if (\is_array($contact)) {
952952
$result = $contact;
@@ -1059,7 +1059,7 @@ protected function getCardId($addressBookId, $uri) {
10591059

10601060
$result = $query->execute();
10611061
$cardIds = $result->fetch();
1062-
$result->closeCursor();
1062+
$result->free();
10631063

10641064
if (!isset($cardIds['id'])) {
10651065
throw new \InvalidArgumentException('Card does not exist: ' . $uri);

apps/dav/lib/DAV/AbstractCustomPropertiesBackend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ protected function fetchProperties($sql, $whereValues, $whereTypes) {
249249
$props[$row['propertyname']] = $this->decodeValue($row['propertyvalue'], (int) $row['propertytype']);
250250
}
251251

252-
$result->closeCursor();
252+
$result->free();
253253
return $props;
254254
}
255255

apps/dav/lib/DAV/FileCustomPropertiesBackend.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function delete($path) {
116116
$statement = $this->connection->prepare(self::DELETE_BY_ID_STMT);
117117
$statement->execute([$fileId]);
118118
$this->offsetUnset($fileId);
119-
$statement->closeCursor();
119+
$statement->free();
120120
}
121121
}
122122

@@ -263,7 +263,7 @@ protected function loadChildrenProperties(INode $node, $requestedProperties) {
263263
$props[$row['propertyname']] = $this->decodeValue($row['propertyvalue'], (int) $row['propertytype']);
264264
$this->offsetSet($row['fileid'], $props);
265265
}
266-
$result->closeCursor();
266+
$result->free();
267267
}
268268
}
269269

apps/dav/lib/DAV/MiscCustomPropertiesBackend.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function delete($path) {
5858

5959
$statement = $this->connection->prepare(self::DELETE_BY_PATH_STMT);
6060
$statement->execute([$path]);
61-
$statement->closeCursor();
61+
$statement->free();
6262
$this->offsetUnset($path);
6363
}
6464

@@ -78,7 +78,7 @@ public function move($source, $destination) {
7878

7979
$statement = $this->connection->prepare(self::UPDATE_BY_PATH_STMT);
8080
$statement->execute([$destination, $source]);
81-
$statement->closeCursor();
81+
$statement->free();
8282
}
8383

8484
/**

apps/dav/lib/Repair/RemoveInvalidShares.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function run(IOutput $output) {
9494
}
9595
}
9696

97-
$result->closeCursor();
97+
$result->free();
9898
}
9999

100100
/**

apps/dav/tests/unit/DAV/FileCustomPropertiesBackendTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function tearDown(): void {
120120
$this->maxId,
121121
]
122122
);
123-
$deleteStatement->closeCursor();
123+
$deleteStatement->free();
124124
}
125125

126126
private function createTestNode($class) {

apps/dav/tests/unit/DAV/MiscCustomPropertiesBackendTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function tearDown(): void {
100100
$this->maxId,
101101
]
102102
);
103-
$deleteStatement->closeCursor();
103+
$deleteStatement->free();
104104
}
105105

106106
/**

apps/dav/tests/unit/Repair/RemoveInvalidSharesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function test() {
6464
$result = $query->select('*')->from('dav_shares')
6565
->where($query->expr()->eq('principaluri', $query->createNamedParameter('principal:unknown')))->execute();
6666
$data = $result->fetchAll();
67-
$result->closeCursor();
67+
$result->free();
6868
$this->assertCount(0, $data);
6969
}
7070
}

apps/federatedfilesharing/lib/Command/PollIncomingShares.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function execute(InputInterface $input, OutputInterface $output): int {
133133
}
134134
}
135135
}
136-
$cursor->closeCursor();
136+
$cursor->free();
137137
return 0;
138138
}
139139

0 commit comments

Comments
 (0)