PageRenderTime 56ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php

https://gitlab.com/geeta7/drupal
PHP | 228 lines | 27 code | 27 blank | 174 comment | 0 complexity | 20d86e39668cdda9699c1ac741ebb10f MD5 | raw file
  1. <?php
  2. /**
  3. * @file
  4. * Contains \Drupal\Core\StreamWrapper\PhpStreamWrapperInterface.
  5. */
  6. namespace Drupal\Core\StreamWrapper;
  7. /**
  8. * Defines a generic PHP stream wrapper interface.
  9. *
  10. * @see http://www.php.net/manual/class.streamwrapper.php
  11. */
  12. interface PhpStreamWrapperInterface {
  13. /**
  14. * @return bool
  15. */
  16. public function dir_closedir();
  17. /**
  18. * @return bool
  19. */
  20. public function dir_opendir($path, $options);
  21. /**
  22. * @return string
  23. */
  24. public function dir_readdir();
  25. /**
  26. * @return bool
  27. */
  28. public function dir_rewinddir();
  29. /**
  30. * @return bool
  31. */
  32. public function mkdir($path, $mode, $options);
  33. /**
  34. * @return bool
  35. */
  36. public function rename($path_from, $path_to);
  37. /**
  38. * @return bool
  39. */
  40. public function rmdir($path, $options);
  41. /**
  42. * Retrieve the underlying stream resource.
  43. *
  44. * This method is called in response to stream_select().
  45. *
  46. * @param int $cast_as
  47. * Can be STREAM_CAST_FOR_SELECT when stream_select() is calling
  48. * stream_cast() or STREAM_CAST_AS_STREAM when stream_cast() is called for
  49. * other uses.
  50. *
  51. * @return resource|false
  52. * The underlying stream resource or FALSE if stream_select() is not
  53. * supported.
  54. *
  55. * @see stream_select()
  56. * @see http://php.net/manual/streamwrapper.stream-cast.php
  57. */
  58. public function stream_cast($cast_as);
  59. /**
  60. * @return void
  61. */
  62. public function stream_close();
  63. /**
  64. * @return bool
  65. */
  66. public function stream_eof();
  67. /**
  68. * @return bool
  69. */
  70. public function stream_flush();
  71. /**
  72. * @return bool
  73. */
  74. public function stream_lock($operation);
  75. /**
  76. * Sets metadata on the stream.
  77. *
  78. * @param string $path
  79. * A string containing the URI to the file to set metadata on.
  80. * @param int $option
  81. * One of:
  82. * - STREAM_META_TOUCH: The method was called in response to touch().
  83. * - STREAM_META_OWNER_NAME: The method was called in response to chown()
  84. * with string parameter.
  85. * - STREAM_META_OWNER: The method was called in response to chown().
  86. * - STREAM_META_GROUP_NAME: The method was called in response to chgrp().
  87. * - STREAM_META_GROUP: The method was called in response to chgrp().
  88. * - STREAM_META_ACCESS: The method was called in response to chmod().
  89. * @param mixed $value
  90. * If option is:
  91. * - STREAM_META_TOUCH: Array consisting of two arguments of the touch()
  92. * function.
  93. * - STREAM_META_OWNER_NAME or STREAM_META_GROUP_NAME: The name of the owner
  94. * user/group as string.
  95. * - STREAM_META_OWNER or STREAM_META_GROUP: The value of the owner
  96. * user/group as integer.
  97. * - STREAM_META_ACCESS: The argument of the chmod() as integer.
  98. *
  99. * @return bool
  100. * Returns TRUE on success or FALSE on failure. If $option is not
  101. * implemented, FALSE should be returned.
  102. *
  103. * @see http://www.php.net/manual/streamwrapper.stream-metadata.php
  104. */
  105. public function stream_metadata($path, $option, $value);
  106. /**
  107. * @return bool
  108. */
  109. public function stream_open($path, $mode, $options, &$opened_path);
  110. /**
  111. * @return string
  112. */
  113. public function stream_read($count);
  114. /**
  115. * Seeks to specific location in a stream.
  116. *
  117. * This method is called in response to fseek().
  118. *
  119. * The read/write position of the stream should be updated according to the
  120. * offset and whence.
  121. *
  122. * @param int $offset
  123. * The byte offset to seek to.
  124. * @param int $whence
  125. * Possible values:
  126. * - SEEK_SET: Set position equal to offset bytes.
  127. * - SEEK_CUR: Set position to current location plus offset.
  128. * - SEEK_END: Set position to end-of-file plus offset.
  129. * Defaults to SEEK_SET.
  130. *
  131. * @return bool
  132. * TRUE if the position was updated, FALSE otherwise.
  133. *
  134. * @see http://php.net/manual/streamwrapper.stream-seek.php
  135. */
  136. public function stream_seek($offset, $whence = SEEK_SET);
  137. /**
  138. * Change stream options.
  139. *
  140. * This method is called to set options on the stream.
  141. *
  142. * @param int $option
  143. * One of:
  144. * - STREAM_OPTION_BLOCKING: The method was called in response to
  145. * stream_set_blocking().
  146. * - STREAM_OPTION_READ_TIMEOUT: The method was called in response to
  147. * stream_set_timeout().
  148. * - STREAM_OPTION_WRITE_BUFFER: The method was called in response to
  149. * stream_set_write_buffer().
  150. * @param int $arg1
  151. * If option is:
  152. * - STREAM_OPTION_BLOCKING: The requested blocking mode:
  153. * - 1 means blocking.
  154. * - 0 means not blocking.
  155. * - STREAM_OPTION_READ_TIMEOUT: The timeout in seconds.
  156. * - STREAM_OPTION_WRITE_BUFFER: The buffer mode, STREAM_BUFFER_NONE or
  157. * STREAM_BUFFER_FULL.
  158. * @param int $arg2
  159. * If option is:
  160. * - STREAM_OPTION_BLOCKING: This option is not set.
  161. * - STREAM_OPTION_READ_TIMEOUT: The timeout in microseconds.
  162. * - STREAM_OPTION_WRITE_BUFFER: The requested buffer size.
  163. *
  164. * @return bool
  165. * TRUE on success, FALSE otherwise. If $option is not implemented, FALSE
  166. * should be returned.
  167. */
  168. public function stream_set_option($option, $arg1, $arg2);
  169. /**
  170. * @return array
  171. */
  172. public function stream_stat();
  173. /**
  174. * @return int
  175. */
  176. public function stream_tell();
  177. /**
  178. * Truncate stream.
  179. *
  180. * Will respond to truncation; e.g., through ftruncate().
  181. *
  182. * @param int $new_size
  183. * The new size.
  184. *
  185. * @return bool
  186. * TRUE on success, FALSE otherwise.
  187. */
  188. public function stream_truncate($new_size);
  189. /**
  190. * @return int
  191. */
  192. public function stream_write($data);
  193. /**
  194. * @return bool
  195. */
  196. public function unlink($path);
  197. /**
  198. * @return array
  199. */
  200. public function url_stat($path, $flags);
  201. }