You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NullCache.php 1.6KB

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