1
0

NoopLockingProvider.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Robin Appelman <robin@icewind.nl>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. * @author Vincent Petry <vincent@nextcloud.com>
  9. *
  10. * @license AGPL-3.0
  11. *
  12. * This code is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License, version 3,
  14. * as published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License, version 3,
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>
  23. *
  24. */
  25. namespace OC\Lock;
  26. use OCP\Lock\ILockingProvider;
  27. /**
  28. * Locking provider that does nothing.
  29. *
  30. * To be used when locking is disabled.
  31. */
  32. class NoopLockingProvider implements ILockingProvider {
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function isLocked(string $path, int $type): bool {
  37. return false;
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. public function acquireLock(string $path, int $type, ?string $readablePath = null): void {
  43. // do nothing
  44. }
  45. /**
  46. * {@inheritdoc}
  47. */
  48. public function releaseLock(string $path, int $type): void {
  49. // do nothing
  50. }
  51. /**1
  52. * {@inheritdoc}
  53. */
  54. public function releaseAll(): void {
  55. // do nothing
  56. }
  57. /**
  58. * {@inheritdoc}
  59. */
  60. public function changeLock(string $path, int $targetType): void {
  61. // do nothing
  62. }
  63. }