iCache.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace Luracast\Restler;
  3. /**
  4. * Interface for the cache system that manages caching of given data
  5. *
  6. * @category Framework
  7. * @package Restler
  8. * @author R.Arul Kumaran <arul@luracast.com>
  9. * @copyright 2010 Luracast
  10. * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
  11. * @link http://luracast.com/products/restler/
  12. *
  13. */
  14. interface iCache
  15. {
  16. /**
  17. * store data in the cache
  18. *
  19. * @abstract
  20. *
  21. * @param string $name
  22. * @param mixed $data
  23. *
  24. * @return boolean true if successful
  25. */
  26. public function set($name, $data);
  27. /**
  28. * retrieve data from the cache
  29. *
  30. * @abstract
  31. *
  32. * @param string $name
  33. * @param bool $ignoreErrors
  34. *
  35. * @return mixed
  36. */
  37. public function get($name, $ignoreErrors = false);
  38. /**
  39. * delete data from the cache
  40. *
  41. * @abstract
  42. *
  43. * @param string $name
  44. * @param bool $ignoreErrors
  45. *
  46. * @return boolean true if successful
  47. */
  48. public function clear($name, $ignoreErrors = false);
  49. /**
  50. * check if the given name is cached
  51. *
  52. * @abstract
  53. *
  54. * @param string $name
  55. *
  56. * @return boolean true if cached
  57. */
  58. public function isCached($name);
  59. }