diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-09-16 21:48:18 +0200 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-09-23 09:46:44 +0200 |
commit | 94b0a0e86337ff9ec7592e1df5fb785286665884 (patch) | |
tree | 6bdf64ea82ada7d17a3d4467caf851a271eee4d2 /apps | |
parent | ba41f32e3e5e0bdcfd7501da7088b417172e975f (diff) | |
download | nextcloud-server-94b0a0e86337ff9ec7592e1df5fb785286665884.tar.gz nextcloud-server-94b0a0e86337ff9ec7592e1df5fb785286665884.zip |
fix: Move storage constructor to specific interface
That allows Wrappers to use DI and not care about the constructor
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps')
-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 |