1
0

NullCache.php 978 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 ncad(string $key, mixed $old): bool {
  37. return true;
  38. }
  39. public function clear($prefix = '') {
  40. return true;
  41. }
  42. public static function isAvailable(): bool {
  43. return true;
  44. }
  45. }