Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

StreamInterface.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 4.69 KiB


001  <?php
002   
003  declare(strict_types=1);
004   
005  namespace Psr\Http\Message;
006   
007  /**
008   * Describes a data stream.
009   *
010   * Typically, an instance will wrap a PHP stream; this interface provides
011   * a wrapper around the most common operations, including serialization of
012   * the entire stream to a string.
013   */
014  interface StreamInterface
015  {
016      /**
017       * Reads all data from the stream into a string, from the beginning to end.
018       *
019       * This method MUST attempt to seek to the beginning of the stream before
020       * reading data and read the stream until the end is reached.
021       *
022       * Warning: This could attempt to load a large amount of data into memory.
023       *
024       * This method MUST NOT raise an exception in order to conform with PHP's
025       * string casting operations.
026       *
027       * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring
028       * @return string
029       */
030      public function __toString();
031   
032      /**
033       * Closes the stream and any underlying resources.
034       *
035       * @return void
036       */
037      public function close();
038   
039      /**
040       * Separates any underlying resources from the stream.
041       *
042       * After the stream has been detached, the stream is in an unusable state.
043       *
044       * @return resource|null Underlying PHP stream, if any
045       */
046      public function detach();
047   
048      /**
049       * Get the size of the stream if known.
050       *
051       * @return int|null Returns the size in bytes if known, or null if unknown.
052       */
053      public function getSize();
054   
055      /**
056       * Returns the current position of the file read/write pointer
057       *
058       * @return int Position of the file pointer
059       * @throws \RuntimeException on error.
060       */
061      public function tell();
062   
063      /**
064       * Returns true if the stream is at the end of the stream.
065       *
066       * @return bool
067       */
068      public function eof();
069   
070      /**
071       * Returns whether or not the stream is seekable.
072       *
073       * @return bool
074       */
075      public function isSeekable();
076   
077      /**
078       * Seek to a position in the stream.
079       *
080       * @link http://www.php.net/manual/en/function.fseek.php
081       * @param int $offset Stream offset
082       * @param int $whence Specifies how the cursor position will be calculated
083       *     based on the seek offset. Valid values are identical to the built-in
084       *     PHP $whence values for `fseek()`.  SEEK_SET: Set position equal to
085       *     offset bytes SEEK_CUR: Set position to current location plus offset
086       *     SEEK_END: Set position to end-of-stream plus offset.
087       * @throws \RuntimeException on failure.
088       */
089      public function seek(int $offset, int $whence = SEEK_SET);
090   
091      /**
092       * Seek to the beginning of the stream.
093       *
094       * If the stream is not seekable, this method will raise an exception;
095       * otherwise, it will perform a seek(0).
096       *
097       * @see seek()
098       * @link http://www.php.net/manual/en/function.fseek.php
099       * @throws \RuntimeException on failure.
100       */
101      public function rewind();
102   
103      /**
104       * Returns whether or not the stream is writable.
105       *
106       * @return bool
107       */
108      public function isWritable();
109   
110      /**
111       * Write data to the stream.
112       *
113       * @param string $string The string that is to be written.
114       * @return int Returns the number of bytes written to the stream.
115       * @throws \RuntimeException on failure.
116       */
117      public function write(string $string);
118   
119      /**
120       * Returns whether or not the stream is readable.
121       *
122       * @return bool
123       */
124      public function isReadable();
125   
126      /**
127       * Read data from the stream.
128       *
129       * @param int $length Read up to $length bytes from the object and return
130       *     them. Fewer than $length bytes may be returned if underlying stream
131       *     call returns fewer bytes.
132       * @return string Returns the data read from the stream, or an empty string
133       *     if no bytes are available.
134       * @throws \RuntimeException if an error occurs.
135       */
136      public function read(int $length);
137   
138      /**
139       * Returns the remaining contents in a string
140       *
141       * @return string
142       * @throws \RuntimeException if unable to read or an error occurs while
143       *     reading.
144       */
145      public function getContents();
146   
147      /**
148       * Get stream metadata as an associative array or retrieve a specific key.
149       *
150       * The keys returned are identical to the keys returned from PHP's
151       * stream_get_meta_data() function.
152       *
153       * @link http://php.net/manual/en/function.stream-get-meta-data.php
154       * @param string|null $key Specific metadata to retrieve.
155       * @return array|mixed|null Returns an associative array if no key is
156       *     provided. Returns a specific key value if a key is provided and the
157       *     value is found, or null if the key is not found.
158       */
159      public function getMetadata(?string $key = null);
160  }
161