StorageInterface.Class.php 969 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Mall\Framework\Cache;
  3. interface StorageInterface
  4. {
  5. /**
  6. * @param string $key
  7. *
  8. * @return mixed
  9. */
  10. public function get($key);
  11. /**
  12. * @param $key
  13. * @param null $value
  14. * @param null $ttl
  15. *
  16. * @return mixed
  17. */
  18. public function set($key, $value = null, $ttl = null);
  19. /**
  20. * @param string $key
  21. *
  22. * @return bool
  23. */
  24. public function has($key);
  25. /**
  26. * @param string $key
  27. *
  28. * @return bool
  29. */
  30. public function delete($key);
  31. /**
  32. * @param string $key
  33. * @param mixed $value
  34. * @param string $type start | end
  35. *
  36. * @return int|bool The new value on success, false on failure
  37. */
  38. public function push($key, $value, $type = 'end');
  39. /**
  40. * @param string $key
  41. * @param string $type start | end
  42. * @return int|bool The new value on success, false on failure
  43. */
  44. public function pop($key, $type = 'start');
  45. }