CacheInterface.php 861 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /*
  3. * This file is part of the php-phantomjs.
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. namespace JonnyW\PhantomJs\Cache;
  9. /**
  10. * PHP PhantomJs.
  11. *
  12. * @author Jon Wenmoth <contact@jonnyw.me>
  13. */
  14. interface CacheInterface
  15. {
  16. /**
  17. * Write data to storage.
  18. *
  19. * @param string $id
  20. * @param string $data
  21. *
  22. * @return string
  23. */
  24. public function save($id, $data);
  25. /**
  26. * Fetch data from file.
  27. *
  28. * @param string $id
  29. */
  30. public function fetch($id);
  31. /**
  32. * Delete data from storage.
  33. *
  34. * @param string $id
  35. */
  36. public function delete($id);
  37. /**
  38. * Data exists in storage.
  39. *
  40. * @param string $id
  41. *
  42. * @return bool
  43. */
  44. public function exists($id);
  45. }