summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-06-01 07:51:04 +0200
committerJoas Schilling <coding@schilljs.com>2023-08-23 09:08:08 +0200
commit26c734abe4a5a524870a4ec95064958635eea888 (patch)
treeaf5b5ce449c46a386232d80033466323017dcc40 /apps/files_sharing/lib
parentc9a197e6dd699942b0cf36504ff1fa5f5ef26893 (diff)
downloadnextcloud-server-26c734abe4a5a524870a4ec95064958635eea888.tar.gz
nextcloud-server-26c734abe4a5a524870a4ec95064958635eea888.zip
fix(tests): Specify all positional parameters again to fix tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Command/CleanupRemoteStorages.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/apps/files_sharing/lib/Command/CleanupRemoteStorages.php b/apps/files_sharing/lib/Command/CleanupRemoteStorages.php
index 3816a2a5124..de4c7862785 100644
--- a/apps/files_sharing/lib/Command/CleanupRemoteStorages.php
+++ b/apps/files_sharing/lib/Command/CleanupRemoteStorages.php
@@ -113,8 +113,9 @@ class CleanupRemoteStorages extends Command {
$queryBuilder->createNamedParameter($numericId, IQueryBuilder::PARAM_STR),
IQueryBuilder::PARAM_STR)
);
- $result = $queryBuilder->execute();
+ $result = $queryBuilder->executeQuery();
$count = $result->fetchOne();
+ $result->closeCursor();
$output->writeln("$count files can be deleted for storage $numericId");
}
@@ -127,7 +128,7 @@ class CleanupRemoteStorages extends Command {
IQueryBuilder::PARAM_STR)
);
$output->write("deleting $id [$numericId] ... ");
- $count = $queryBuilder->execute();
+ $count = $queryBuilder->executeStatement();
$output->writeln("deleted $count storage");
$this->deleteFiles($numericId, $output);
}
@@ -141,7 +142,7 @@ class CleanupRemoteStorages extends Command {
IQueryBuilder::PARAM_STR)
);
$output->write("deleting files for storage $numericId ... ");
- $count = $queryBuilder->execute();
+ $count = $queryBuilder->executeStatement();
$output->writeln("deleted $count files");
}
@@ -160,14 +161,16 @@ class CleanupRemoteStorages extends Command {
// but not the ones starting with a '/', they are for normal shares
$queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/') . '%'),
IQueryBuilder::PARAM_STR)
- )->orderBy('numeric_id');
- $query = $queryBuilder->execute();
+ )
+ ->orderBy('numeric_id');
+ $result = $queryBuilder->executeQuery();
$remoteStorages = [];
- while ($row = $query->fetch()) {
+ while ($row = $result->fetch()) {
$remoteStorages[$row['id']] = $row['numeric_id'];
}
+ $result->closeCursor();
return $remoteStorages;
}
@@ -176,16 +179,17 @@ class CleanupRemoteStorages extends Command {
$queryBuilder = $this->connection->getQueryBuilder();
$queryBuilder->select(['id', 'share_token', 'owner', 'remote'])
->from('share_external');
- $query = $queryBuilder->execute();
+ $result = $queryBuilder->executeQuery();
$remoteShareIds = [];
- while ($row = $query->fetch()) {
+ while ($row = $result->fetch()) {
$cloudId = $this->cloudIdManager->getCloudId($row['owner'], $row['remote']);
$remote = $cloudId->getRemote();
$remoteShareIds[$row['id']] = 'shared::' . md5($row['share_token'] . '@' . $remote);
}
+ $result->closeCursor();
return $remoteShareIds;
}