ReadInterface.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace League\Flysystem;
  3. interface ReadInterface
  4. {
  5. /**
  6. * Check whether a file exists.
  7. *
  8. * @param string $path
  9. *
  10. * @return array|bool|null
  11. */
  12. public function has($path);
  13. /**
  14. * Read a file.
  15. *
  16. * @param string $path
  17. *
  18. * @return array|false
  19. */
  20. public function read($path);
  21. /**
  22. * Read a file as a stream.
  23. *
  24. * @param string $path
  25. *
  26. * @return array|false
  27. */
  28. public function readStream($path);
  29. /**
  30. * List contents of a directory.
  31. *
  32. * @param string $directory
  33. * @param bool $recursive
  34. *
  35. * @return array
  36. */
  37. public function listContents($directory = '', $recursive = false);
  38. /**
  39. * Get all the meta data of a file or directory.
  40. *
  41. * @param string $path
  42. *
  43. * @return array|false
  44. */
  45. public function getMetadata($path);
  46. /**
  47. * Get the size of a file.
  48. *
  49. * @param string $path
  50. *
  51. * @return array|false
  52. */
  53. public function getSize($path);
  54. /**
  55. * Get the mimetype of a file.
  56. *
  57. * @param string $path
  58. *
  59. * @return array|false
  60. */
  61. public function getMimetype($path);
  62. /**
  63. * Get the last modified time of a file as a timestamp.
  64. *
  65. * @param string $path
  66. *
  67. * @return array|false
  68. */
  69. public function getTimestamp($path);
  70. /**
  71. * Get the visibility of a file.
  72. *
  73. * @param string $path
  74. *
  75. * @return array|false
  76. */
  77. public function getVisibility($path);
  78. }