NoopLockingProvider.php 966 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  6. * SPDX-License-Identifier: AGPL-3.0-only
  7. */
  8. namespace OC\Lock;
  9. use OCP\Lock\ILockingProvider;
  10. /**
  11. * Locking provider that does nothing.
  12. *
  13. * To be used when locking is disabled.
  14. */
  15. class NoopLockingProvider implements ILockingProvider {
  16. /**
  17. * {@inheritdoc}
  18. */
  19. public function isLocked(string $path, int $type): bool {
  20. return false;
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function acquireLock(string $path, int $type, ?string $readablePath = null): void {
  26. // do nothing
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function releaseLock(string $path, int $type): void {
  32. // do nothing
  33. }
  34. /**1
  35. * {@inheritdoc}
  36. */
  37. public function releaseAll(): void {
  38. // do nothing
  39. }
  40. /**
  41. * {@inheritdoc}
  42. */
  43. public function changeLock(string $path, int $targetType): void {
  44. // do nothing
  45. }
  46. }