diff options
Diffstat (limited to 'lib/private/Repair/RepairInvalidShares.php')
-rw-r--r-- | lib/private/Repair/RepairInvalidShares.php | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/lib/private/Repair/RepairInvalidShares.php b/lib/private/Repair/RepairInvalidShares.php index 71e6359da5b..9553f25ee70 100644 --- a/lib/private/Repair/RepairInvalidShares.php +++ b/lib/private/Repair/RepairInvalidShares.php @@ -7,6 +7,8 @@ */ namespace OC\Repair; +use OCP\IConfig; +use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; @@ -16,19 +18,10 @@ use OCP\Migration\IRepairStep; class RepairInvalidShares implements IRepairStep { public const CHUNK_SIZE = 200; - /** @var \OCP\IConfig */ - protected $config; - - /** @var \OCP\IDBConnection */ - protected $connection; - - /** - * @param \OCP\IConfig $config - * @param \OCP\IDBConnection $connection - */ - public function __construct($config, $connection) { - $this->connection = $connection; - $this->config = $config; + public function __construct( + protected IConfig $config, + protected IDBConnection $connection, + ) { } public function getName() { @@ -49,7 +42,7 @@ class RepairInvalidShares implements IRepairStep { ->where($builder->expr()->eq('item_type', $builder->expr()->literal('file'))) ->andWhere($builder->expr()->neq('permissions', $permsFunc)); - $updatedEntries = $builder->execute(); + $updatedEntries = $builder->executeStatement(); if ($updatedEntries > 0) { $out->info('Fixed file share permissions for ' . $updatedEntries . ' shares'); } @@ -77,11 +70,11 @@ class RepairInvalidShares implements IRepairStep { $deletedInLastChunk = self::CHUNK_SIZE; while ($deletedInLastChunk === self::CHUNK_SIZE) { $deletedInLastChunk = 0; - $result = $query->execute(); + $result = $query->executeQuery(); while ($row = $result->fetch()) { $deletedInLastChunk++; $deletedEntries += $deleteQuery->setParameter('parent', (int)$row['parent']) - ->execute(); + ->executeStatement(); } $result->closeCursor(); } |