diff options
author | Joas Schilling <coding@schilljs.com> | 2023-06-01 07:51:04 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-08-23 09:08:08 +0200 |
commit | 26c734abe4a5a524870a4ec95064958635eea888 (patch) | |
tree | af5b5ce449c46a386232d80033466323017dcc40 /apps/files_sharing/lib | |
parent | c9a197e6dd699942b0cf36504ff1fa5f5ef26893 (diff) | |
download | nextcloud-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.php | 20 |
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; } |