isession.php 995 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Thomas Tanghus (thomas@tanghus.net)
  4. * @author Thomas Tanghus
  5. * @author Robin Appelman
  6. * This file is licensed under the Affero General Public License version 3 or
  7. * later.
  8. * See the COPYING-README file.
  9. */
  10. namespace OCP;
  11. /**
  12. * Interface ISession
  13. *
  14. * wrap PHP's internal session handling into the ISession interface
  15. */
  16. interface ISession {
  17. /**
  18. * Set a value in the session
  19. *
  20. * @param string $key
  21. * @param mixed $value
  22. */
  23. public function set($key, $value);
  24. /**
  25. * Get a value from the session
  26. *
  27. * @param string $key
  28. * @return mixed should return null if $key does not exist
  29. */
  30. public function get($key);
  31. /**
  32. * Check if a named key exists in the session
  33. *
  34. * @param string $key
  35. * @return bool
  36. */
  37. public function exists($key);
  38. /**
  39. * Remove a $key/$value pair from the session
  40. *
  41. * @param string $key
  42. */
  43. public function remove($key);
  44. /**
  45. * Reset and recreate the session
  46. */
  47. public function clear();
  48. }