0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-02-12 12:09:14 +00:00
nextcloud_server/apps/files/lib/Migration/Version2003Date20241021095629.php
provokateurin ba3d67d2a0
feat(files): Expose chunked upload config via capabilities
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-21 12:03:33 +02:00

36 lines
974 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Files\Migration;
use Closure;
use OCA\Files\Service\ChunkedUploadConfig;
use OCP\DB\ISchemaWrapper;
use OCP\IConfig;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use OCP\Server;
class Version2003Date20241021095629 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
$maxChunkSize = Server::get(IConfig::class)->getAppValue('files', 'max_chunk_size');
if ($maxChunkSize === '') {
// Skip if no value was configured before
return;
}
ChunkedUploadConfig::setMaxChunkSize((int)$maxChunkSize);
Server::get(IConfig::class)->deleteAppValue('files', 'max_chunk_size');
}
}