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.

imemcache.php 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /**
  3. * @author Morris Jobke <hey@morrisjobke.de>
  4. * @author Robin Appelman <icewind@owncloud.com>
  5. *
  6. * @copyright Copyright (c) 2016, ownCloud, Inc.
  7. * @license AGPL-3.0
  8. *
  9. * This code is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License, version 3,
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>
  20. *
  21. */
  22. /**
  23. * Public interface of ownCloud for apps to use.
  24. * Cache interface
  25. *
  26. */
  27. // use OCP namespace for all classes that are considered public.
  28. // This means that they should be used by apps instead of the internal ownCloud classes
  29. namespace OCP;
  30. /**
  31. * This interface defines method for accessing the file based user cache.
  32. *
  33. * @since 8.1.0
  34. */
  35. interface IMemcache extends ICache {
  36. /**
  37. * Set a value in the cache if it's not already stored
  38. *
  39. * @param string $key
  40. * @param mixed $value
  41. * @param int $ttl Time To Live in seconds. Defaults to 60*60*24
  42. * @return bool
  43. * @since 8.1.0
  44. */
  45. public function add($key, $value, $ttl = 0);
  46. /**
  47. * Increase a stored number
  48. *
  49. * @param string $key
  50. * @param int $step
  51. * @return int | bool
  52. * @since 8.1.0
  53. */
  54. public function inc($key, $step = 1);
  55. /**
  56. * Decrease a stored number
  57. *
  58. * @param string $key
  59. * @param int $step
  60. * @return int | bool
  61. * @since 8.1.0
  62. */
  63. public function dec($key, $step = 1);
  64. /**
  65. * Compare and set
  66. *
  67. * @param string $key
  68. * @param mixed $old
  69. * @param mixed $new
  70. * @return bool
  71. * @since 8.1.0
  72. */
  73. public function cas($key, $old, $new);
  74. /**
  75. * Compare and delete
  76. *
  77. * @param string $key
  78. * @param mixed $old
  79. * @return bool
  80. * @since 8.1.0
  81. */
  82. public function cad($key, $old);
  83. }