CacheInterface.php 765 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Jenner
  5. * Date: 2015/8/12
  6. * Time: 14:59
  7. */
  8. namespace Jenner\SimpleFork\Cache;
  9. /**
  10. * cache for processes shared variables
  11. *
  12. * @package Jenner\SimpleFork\Cache
  13. */
  14. interface CacheInterface
  15. {
  16. /**
  17. * get var
  18. *
  19. * @param $key
  20. * @param null $default
  21. * @return bool|mixed
  22. */
  23. public function get($key, $default = null);
  24. /**
  25. * set var
  26. *
  27. * @param $key
  28. * @param null $value
  29. * @return
  30. */
  31. public function set($key, $value);
  32. /**
  33. * has var ?
  34. *
  35. * @param $key
  36. * @return bool
  37. */
  38. public function has($key);
  39. /**
  40. * delete var
  41. *
  42. * @param $key
  43. * @return bool
  44. */
  45. public function delete($key);
  46. }