CacheStrategy.interface.php 928 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Interface for cache provider strategies
  4. *
  5. * @author Christopher Han <xiphux@gmail.com>
  6. * @copyright Copyright (c) 2012 Christopher Han
  7. * @package GitPHP
  8. * @subpackage Cache
  9. */
  10. interface GitPHP_CacheStrategy_Interface
  11. {
  12. /**
  13. * Gets an item from the cache
  14. *
  15. * @param string $key cache key
  16. * @return mixed cached object or false if not found
  17. */
  18. public function Get($key);
  19. /**
  20. * Sets an item into the cache
  21. *
  22. * @param string $key cache key
  23. * @param mixed $value object to cache
  24. * @param int $lifetime cached object lifetime
  25. */
  26. public function Set($key, $value, $lifetime);
  27. /**
  28. * Check if an item exists
  29. *
  30. * @param string $key cache key
  31. * @return boolean true if exists
  32. */
  33. public function Exists($key);
  34. /**
  35. * Delete an item from the cache
  36. *
  37. * @param string $key cache key
  38. */
  39. public function Delete($key);
  40. /**
  41. * Clear the cache
  42. */
  43. public function Clear();
  44. }