1
0

NoopLockingProvider.php 1.5 KB

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