NullCache.php 903 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 OC\Memcache;
  8. class NullCache extends Cache implements \OCP\IMemcache {
  9. public function get($key) {
  10. return null;
  11. }
  12. public function set($key, $value, $ttl = 0) {
  13. return true;
  14. }
  15. public function hasKey($key) {
  16. return false;
  17. }
  18. public function remove($key) {
  19. return true;
  20. }
  21. public function add($key, $value, $ttl = 0) {
  22. return true;
  23. }
  24. public function inc($key, $step = 1) {
  25. return true;
  26. }
  27. public function dec($key, $step = 1) {
  28. return true;
  29. }
  30. public function cas($key, $old, $new) {
  31. return true;
  32. }
  33. public function cad($key, $old) {
  34. return true;
  35. }
  36. public function clear($prefix = '') {
  37. return true;
  38. }
  39. public static function isAvailable(): bool {
  40. return true;
  41. }
  42. }