CacheInterface.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /*
  3. * This file is part of the Assetic package, an OpenSky project.
  4. *
  5. * (c) 2010-2011 OpenSky Project Inc
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Assetic\Cache;
  11. /**
  12. * Interface for a cache backend.
  13. *
  14. * @author Kris Wallsmith <kris.wallsmith@gmail.com>
  15. */
  16. interface CacheInterface
  17. {
  18. /**
  19. * Checks if the cache has a value for a key.
  20. *
  21. * @param string $key A unique key
  22. *
  23. * @return Boolean Whether the cache has a value for this key
  24. */
  25. function has($key);
  26. /**
  27. * Returns the value for a key.
  28. *
  29. * @param string $key A unique key
  30. *
  31. * @return string|null The value in the cache
  32. */
  33. function get($key);
  34. /**
  35. * Sets a value in the cache.
  36. *
  37. * @param string $key A unique key
  38. * @param string $value The value to cache
  39. */
  40. function set($key, $value);
  41. /**
  42. * Removes a value from the cache.
  43. *
  44. * @param string $key A unique key
  45. */
  46. function remove($key);
  47. }