diff options
Diffstat (limited to 'apps/dav/lib/Migration/CalDAVRemoveEmptyValue.php')
-rw-r--r-- | apps/dav/lib/Migration/CalDAVRemoveEmptyValue.php | 50 |
1 files changed, 12 insertions, 38 deletions
diff --git a/apps/dav/lib/Migration/CalDAVRemoveEmptyValue.php b/apps/dav/lib/Migration/CalDAVRemoveEmptyValue.php index 9b96df2ae1e..24e182e46eb 100644 --- a/apps/dav/lib/Migration/CalDAVRemoveEmptyValue.php +++ b/apps/dav/lib/Migration/CalDAVRemoveEmptyValue.php @@ -1,30 +1,11 @@ <?php + /** - * @copyright 2017 Joas Schilling <coding@schilljs.com> - * - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Joas Schilling <coding@schilljs.com> - * @author Julius Härtl <jus@bitgrid.net> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCA\DAV\Migration; -use Doctrine\DBAL\Platforms\OraclePlatform; use OCA\DAV\CalDAV\CalDavBackend; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; @@ -35,18 +16,11 @@ use Sabre\VObject\InvalidDataException; class CalDAVRemoveEmptyValue implements IRepairStep { - /** @var IDBConnection */ - private $db; - - /** @var CalDavBackend */ - private $calDavBackend; - - private LoggerInterface $logger; - - public function __construct(IDBConnection $db, CalDavBackend $calDavBackend, LoggerInterface $logger) { - $this->db = $db; - $this->calDavBackend = $calDavBackend; - $this->logger = $logger; + public function __construct( + private IDBConnection $db, + private CalDavBackend $calDavBackend, + private LoggerInterface $logger, + ) { } public function getName() { @@ -94,13 +68,13 @@ class CalDAVRemoveEmptyValue implements IRepairStep { } protected function getInvalidObjects($pattern) { - if ($this->db->getDatabasePlatform() instanceof OraclePlatform) { + if ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_ORACLE) { $rows = []; $chunkSize = 500; $query = $this->db->getQueryBuilder(); $query->select($query->func()->count('*', 'num_entries')) ->from('calendarobjects'); - $result = $query->execute(); + $result = $query->executeQuery(); $count = $result->fetchOne(); $result->closeCursor(); @@ -112,7 +86,7 @@ class CalDAVRemoveEmptyValue implements IRepairStep { ->setMaxResults($chunkSize); for ($chunk = 0; $chunk < $numChunks; $chunk++) { $query->setFirstResult($chunk * $chunkSize); - $result = $query->execute(); + $result = $query->executeQuery(); while ($row = $result->fetch()) { if (mb_strpos($row['calendardata'], $pattern) !== false) { @@ -137,7 +111,7 @@ class CalDAVRemoveEmptyValue implements IRepairStep { IQueryBuilder::PARAM_STR )); - $result = $query->execute(); + $result = $query->executeQuery(); $rows = $result->fetchAll(); $result->closeCursor(); |