File.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2014 Robin Appelman <robin@icewind.nl>
  4. * SPDX-License-Identifier: MIT
  5. */
  6. namespace Icewind\Streams;
  7. /**
  8. * Interface for stream wrappers that implements a file
  9. */
  10. interface File {
  11. /**
  12. * @param string $path
  13. * @param string $mode
  14. * @param int $options
  15. * @param string $opened_path
  16. * @return bool
  17. */
  18. public function stream_open($path, $mode, $options, &$opened_path);
  19. /**
  20. * @param int $offset
  21. * @param int $whence
  22. * @return bool
  23. */
  24. public function stream_seek($offset, $whence = SEEK_SET);
  25. /**
  26. * @return int|false
  27. */
  28. public function stream_tell();
  29. /**
  30. * @param int $count
  31. * @return string|false
  32. */
  33. public function stream_read($count);
  34. /**
  35. * @param string $data
  36. * @return int|false
  37. */
  38. public function stream_write($data);
  39. /**
  40. * @param int $option
  41. * @param int $arg1
  42. * @param int $arg2
  43. * @return bool
  44. */
  45. public function stream_set_option($option, $arg1, $arg2);
  46. /**
  47. * @param int $size
  48. * @return bool
  49. */
  50. public function stream_truncate($size);
  51. /**
  52. * @return array|false
  53. */
  54. public function stream_stat();
  55. /**
  56. * @param int $operation
  57. * @return bool
  58. */
  59. public function stream_lock($operation);
  60. /**
  61. * @return bool
  62. */
  63. public function stream_flush();
  64. /**
  65. * @return bool
  66. */
  67. public function stream_eof();
  68. /**
  69. * @return bool
  70. */
  71. public function stream_close();
  72. }