NullCache.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Robin Appelman <robin@icewind.nl>
  8. * @author Robin McCorkell <robin@mccorkell.me.uk>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. * @author Vincent Petry <vincent@nextcloud.com>
  11. *
  12. * @license AGPL-3.0
  13. *
  14. * This code is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License, version 3,
  16. * as published by the Free Software Foundation.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License, version 3,
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>
  25. *
  26. */
  27. namespace OC\Memcache;
  28. class NullCache extends Cache implements \OCP\IMemcache {
  29. public function get($key) {
  30. return null;
  31. }
  32. public function set($key, $value, $ttl = 0) {
  33. return true;
  34. }
  35. public function hasKey($key) {
  36. return false;
  37. }
  38. public function remove($key) {
  39. return true;
  40. }
  41. public function add($key, $value, $ttl = 0) {
  42. return true;
  43. }
  44. public function inc($key, $step = 1) {
  45. return true;
  46. }
  47. public function dec($key, $step = 1) {
  48. return true;
  49. }
  50. public function cas($key, $old, $new) {
  51. return true;
  52. }
  53. public function cad($key, $old) {
  54. return true;
  55. }
  56. public function clear($prefix = '') {
  57. return true;
  58. }
  59. public static function isAvailable(): bool {
  60. return true;
  61. }
  62. }