CacheInterface.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. namespace League\Flysystem\Cached;
  3. use League\Flysystem\ReadInterface;
  4. interface CacheInterface extends ReadInterface
  5. {
  6. /**
  7. * Check whether the directory listing of a given directory is complete.
  8. *
  9. * @param string $dirname
  10. * @param bool $recursive
  11. *
  12. * @return bool
  13. */
  14. public function isComplete($dirname, $recursive);
  15. /**
  16. * Set a directory to completely listed.
  17. *
  18. * @param string $dirname
  19. * @param bool $recursive
  20. */
  21. public function setComplete($dirname, $recursive);
  22. /**
  23. * Store the contents of a directory.
  24. *
  25. * @param string $directory
  26. * @param array $contents
  27. * @param bool $recursive
  28. */
  29. public function storeContents($directory, array $contents, $recursive);
  30. /**
  31. * Flush the cache.
  32. */
  33. public function flush();
  34. /**
  35. * Autosave trigger.
  36. */
  37. public function autosave();
  38. /**
  39. * Store the cache.
  40. */
  41. public function save();
  42. /**
  43. * Load the cache.
  44. */
  45. public function load();
  46. /**
  47. * Rename a file.
  48. *
  49. * @param string $path
  50. * @param string $newpath
  51. */
  52. public function rename($path, $newpath);
  53. /**
  54. * Copy a file.
  55. *
  56. * @param string $path
  57. * @param string $newpath
  58. */
  59. public function copy($path, $newpath);
  60. /**
  61. * Delete an object from cache.
  62. *
  63. * @param string $path object path
  64. */
  65. public function delete($path);
  66. /**
  67. * Delete all objects from from a directory.
  68. *
  69. * @param string $dirname directory path
  70. */
  71. public function deleteDir($dirname);
  72. /**
  73. * Update the metadata for an object.
  74. *
  75. * @param string $path object path
  76. * @param array $object object metadata
  77. * @param bool $autosave whether to trigger the autosave routine
  78. */
  79. public function updateObject($path, array $object, $autosave = false);
  80. /**
  81. * Store object hit miss.
  82. *
  83. * @param string $path
  84. */
  85. public function storeMiss($path);
  86. }