IStorageFactory.php 913 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCP\Files\Storage;
  8. use OCP\Files\Mount\IMountPoint;
  9. /**
  10. * Creates storage instances and manages and applies storage wrappers
  11. * @since 8.0.0
  12. */
  13. interface IStorageFactory {
  14. /**
  15. * allow modifier storage behaviour by adding wrappers around storages
  16. *
  17. * $callback should be a function of type (string $mountPoint, Storage $storage) => Storage
  18. *
  19. * @return bool true if the wrapper was added, false if there was already a wrapper with this
  20. * name registered
  21. * @since 8.0.0
  22. */
  23. public function addStorageWrapper(string $wrapperName, callable $callback);
  24. /**
  25. * @return IStorage
  26. * @since 8.0.0
  27. */
  28. public function getInstance(IMountPoint $mountPoint, string $class, array $arguments);
  29. }