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.

isession.php 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * ownCloud
  4. *
  5. * @author Thomas Tanghus
  6. * @author Robin Appelman
  7. * @copyright 2013 Thomas Tanghus thomas@tanghus.net
  8. * @copyright 2013 Robin Appelman icewind@owncloud.com
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  12. * License as published by the Free Software Foundation; either
  13. * version 3 of the License, or any later version.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public
  21. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. /**
  25. * Public interface of ownCloud for apps to use.
  26. * Session interface
  27. *
  28. */
  29. // use OCP namespace for all classes that are considered public.
  30. // This means that they should be used by apps instead of the internal ownCloud classes
  31. namespace OCP;
  32. /**
  33. * Interface ISession
  34. *
  35. * wrap PHP's internal session handling into the ISession interface
  36. */
  37. interface ISession {
  38. /**
  39. * Set a value in the session
  40. *
  41. * @param string $key
  42. * @param mixed $value
  43. */
  44. public function set($key, $value);
  45. /**
  46. * Get a value from the session
  47. *
  48. * @param string $key
  49. * @return mixed should return null if $key does not exist
  50. */
  51. public function get($key);
  52. /**
  53. * Check if a named key exists in the session
  54. *
  55. * @param string $key
  56. * @return bool
  57. */
  58. public function exists($key);
  59. /**
  60. * Remove a $key/$value pair from the session
  61. *
  62. * @param string $key
  63. */
  64. public function remove($key);
  65. /**
  66. * Reset and recreate the session
  67. */
  68. public function clear();
  69. /**
  70. * Close the session and release the lock
  71. */
  72. public function close();
  73. }