nooplockingprovider.php 1.4 KB

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