diff options
author | provokateurin <kate@provokateurin.de> | 2024-10-17 09:19:44 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-10-21 12:03:33 +0200 |
commit | ba3d67d2a001a4288d411a4f32dcd71bd45391d4 (patch) | |
tree | ed4949b1b9866d0e149f923d4efeecacdaffb93c /apps/files/lib/Migration | |
parent | 4d8d11d2f79da348644e0902e78a2f000498cd52 (diff) | |
download | nextcloud-server-ba3d67d2a001a4288d411a4f32dcd71bd45391d4.tar.gz nextcloud-server-ba3d67d2a001a4288d411a4f32dcd71bd45391d4.zip |
feat(files): Expose chunked upload config via capabilitiesfeat/files/chunked-upload-config-capabilities
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/files/lib/Migration')
-rw-r--r-- | apps/files/lib/Migration/Version2003Date20241021095629.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/apps/files/lib/Migration/Version2003Date20241021095629.php b/apps/files/lib/Migration/Version2003Date20241021095629.php new file mode 100644 index 00000000000..30d05fa12ad --- /dev/null +++ b/apps/files/lib/Migration/Version2003Date20241021095629.php @@ -0,0 +1,36 @@ +<?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'); + } +} |