diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-09-23 15:57:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-23 15:57:38 +0200 |
commit | 40b404c5665529ebd661ab032efe24d40ab12df6 (patch) | |
tree | 7bbcfefe1097744294fb4d48ed717e6b324eefa5 /apps/files_external | |
parent | 8927510685f59555cf337866370b572934e41408 (diff) | |
parent | b8ab560bdd1f1f9d80ec6c632323b38a4f007ed7 (diff) | |
download | nextcloud-server-40b404c5665529ebd661ab032efe24d40ab12df6.tar.gz nextcloud-server-40b404c5665529ebd661ab032efe24d40ab12df6.zip |
Merge pull request #48111 from nextcloud/fix/move-storage-constructor-to-specific-interface
fix: Move storage constructor to specific interface
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/Config/ConfigAdapter.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_external/lib/Config/ConfigAdapter.php b/apps/files_external/lib/Config/ConfigAdapter.php index d0437432427..b2246226d33 100644 --- a/apps/files_external/lib/Config/ConfigAdapter.php +++ b/apps/files_external/lib/Config/ConfigAdapter.php @@ -15,11 +15,13 @@ use OCA\Files_External\Service\UserGlobalStoragesService; use OCA\Files_External\Service\UserStoragesService; use OCP\Files\Config\IMountProvider; use OCP\Files\ObjectStore\IObjectStore; +use OCP\Files\Storage\IConstructableStorage; use OCP\Files\Storage\IStorage; use OCP\Files\Storage\IStorageFactory; use OCP\Files\StorageNotAvailableException; use OCP\IUser; use Psr\Clock\ClockInterface; +use Psr\Log\LoggerInterface; /** * Make the old files_external config work with the new public mount config api @@ -62,6 +64,9 @@ class ConfigAdapter implements IMountProvider { */ private function constructStorage(StorageConfig $storageConfig): IStorage { $class = $storageConfig->getBackend()->getStorageClass(); + if (!$class instanceof IConstructableStorage) { + \OCP\Server::get(LoggerInterface::class)->warning('Building a storage not implementing IConstructableStorage is deprecated since 31.0.0', ['class' => $class]); + } $storage = new $class($storageConfig->getBackendOptions()); // auth mechanism should fire first |